feature hourly scheduler
This commit is contained in:
parent
4d238c2972
commit
636a2453e1
Binary file not shown.
14
app.py
14
app.py
@ -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)
|
||||
|
Reference in New Issue
Block a user