Skip to content

Commit

Permalink
Make application add information to the log when it fails to run a model
Browse files Browse the repository at this point in the history
Comments to local settings template
  • Loading branch information
nickrsan committed Jun 2, 2023
1 parent 92c057e commit d9cf8ea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Waterspout/local_settings_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
CSRF_COOKIE_DOMAIN = "openag.ucmerced.edu"
CSRF_TRUSTED_ORIGINS = ["https://openag.ucmerced.edu", "https://openag-dev.ucmerced.edu", "https://dap.ucmerced.edu"]

# You'll want to leave the SERVE_ADDRESS alone in most cases, but ALLOWED_HOSTS is a bit misleading - it's
# You'll want to leave the SERVE_ADDRESS alone in most cases, except when you know that you need to change the port. If you
# change the port, make sure to adjust any reverse proxies/forwarders (ie, nginx or IIS) that access this application via
# WSGI or FastCGI.
# ALLOWED_HOSTS is a bit misleading - it's
# *really* referring to the allowed host*names* that someone can use to connect to this application. So make sure to
# expand the list with any IPs, domains, etc, that may be used to access the application in a browser
SERVE_ADDRESS = "*:8010"
Expand Down
1 change: 1 addition & 0 deletions waterspout_api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -953,6 +953,7 @@ def run(self, csv_output=None, worst_case_csv_output=None):
log.info("Model run complete")
except:
self.ready = False # if we hit an exception, mark it as not ready to run - someone will need to make a fix before it can be run - this ensures we don't run into infinite loops trying to run the same items over and over
log.error(traceback.format_exc())
finally: # make sure to mark it as not running regardless of its status or if it crashes
self.running = False
self.save()
Expand Down

0 comments on commit d9cf8ea

Please sign in to comment.