diff --git a/__pycache__/app.cpython-310.pyc b/__pycache__/app.cpython-310.pyc index 2e81544..e2a1aaa 100644 Binary files a/__pycache__/app.cpython-310.pyc and b/__pycache__/app.cpython-310.pyc differ diff --git a/app.py b/app.py index 819f0b1..964f5d9 100644 --- a/app.py +++ b/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)