Skip to content

Commit

Permalink
updating logic for the retry counter closes #774
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Letter committed Oct 19, 2017
1 parent a53326c commit 63e70ef
Showing 1 changed file with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 63e70ef

Please sign in to comment.