Skip to content

Commit

Permalink
Add main loop error log to capture top-level errors
Browse files Browse the repository at this point in the history
  • Loading branch information
pharr117 committed Sep 11, 2023
1 parent fa99bb5 commit cd8d60a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from datetime import datetime
from datetime import timedelta
from random import shuffle

import traceback
# import logging
import threading
from flask import Flask, jsonify, request, Response
Expand Down Expand Up @@ -718,6 +718,7 @@ def update_data():
datetime.now() - start_time
).total_seconds() # Calculate the elapsed time in case of an error
print(f"Error in update_data loop after {elapsed_time} seconds: {e}")
traceback.print_exc(e)
print("Error encountered. Sleeping for 1 minute before retrying...")
sleep(60)

Expand Down

0 comments on commit cd8d60a

Please sign in to comment.