Skip to content

Commit

Permalink
Merge pull request #212 from stanfordnmbl/dev
Browse files Browse the repository at this point in the history
dev to main update
  • Loading branch information
carmichaelong authored Oct 31, 2024
2 parents 499fac9 + 45f6f5b commit 48c1374
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 4 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
11 changes: 7 additions & 4 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,13 @@
# trigger reset of timer for last processed trial
processTrial(trial["session"], trial["id"], trial_type=trial_type, isDocker=isDocker)

# End process duration timer and post duration to database
process_end_time = datetime.now()
postProcessedDuration(trial_url, process_end_time - process_start_time)

# note a result needs to be posted for the API to know we finished, but we are posting them
# automatically thru procesTrial now
r = requests.patch(trial_url, data={"status": "done"},
headers = {"Authorization": "Token {}".format(API_TOKEN)})
logging.info('0.5s pause if need to restart.')
time.sleep(0.5)

except Exception as e:
r = requests.patch(trial_url, data={"status": "error"},
headers = {"Authorization": "Token {}".format(API_TOKEN)})
Expand All @@ -172,6 +169,12 @@
# message = "A backend OpenCap machine timed out during pose detection. It has been stopped."
# sendStatusEmail(message=message)
# raise Exception('Worker failed. Stopped.')

finally:
# End process duration timer and post duration to database
process_end_time = datetime.now()
postProcessedDuration(trial_url, process_end_time - process_start_time)

justProcessed = True

# Clean data directory
Expand Down

0 comments on commit 48c1374

Please sign in to comment.