feature hourly scheduler

This commit is contained in:
Caretaker0699 2023-06-29 16:44:10 -07:00
parent 4d238c2972
commit 636a2453e1
2 changed files with 14 additions and 0 deletions

Binary file not shown.

14
app.py
View File

@ -104,5 +104,19 @@ def report():
return jsonify(response)
# Schedule the xmldownloader.py to run every hour
def run_xmldownloader():
subprocess.run(['python', 'xmldownloader.py'])
if __name__ == '__main__':
# Schedule the xmldownloader.py to run every hour
schedule.every().hour.do(run_xmldownloader)
# Run the Flask app
app.run()
# Start the scheduled job in a separate thread
while True:
schedule.run_pending()
time.sleep(1)