From 63e70ef55fbaff7d959d4ed65d8ff76631168d47 Mon Sep 17 00:00:00 2001 From: Matthew Letter Date: Thu, 19 Oct 2017 13:18:48 -0600 Subject: [PATCH] updating logic for the retry counter closes #774 --- .../slycat-timeseries-model.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/web-server/plugins/slycat-timeseries-model/slycat-timeseries-model.py b/web-server/plugins/slycat-timeseries-model/slycat-timeseries-model.py index 0bc5beae5..6dc924d37 100644 --- a/web-server/plugins/slycat-timeseries-model/slycat-timeseries-model.py +++ b/web-server/plugins/slycat-timeseries-model/slycat-timeseries-model.py @@ -283,20 +283,16 @@ def checkjob_thread(mid, sid, jid, request_from, stop_event, callback): if state == "FAILED" or state == "UNKNOWN" or state == "NOTQUEUED": cherrypy.log.error("Something went wrong with job %s, trying again..." % jid) - retry_counter = retry_counter - 1 - if retry_counter == 0: - cherrypy.log.error("Job %s has failed" % jid) - fail_model(mid, "Job %s has failed." % jid) - stop_event.set() - break - - # in case something went wrong and still willing to try, wait for 30 - # seconds and try another check - time.sleep(30) + if retry_counter == 0: + cherrypy.log.error("Job %s has failed" % jid) + fail_model(mid, "Job %s has failed." % jid) + stop_event.set() + break + retry_counter = retry_counter - 1 # waits 5 seconds in between each status check - time.sleep(5) + time.sleep(10) # TODO verb, type and command might be obsolete # TODO this function needs to be migrated to the implementation of the computation interface