From dcbc5f134e6a5fd6d4a322d1bc1b173934d42897 Mon Sep 17 00:00:00 2001 From: Geovanny Gonzalez-Rodriguez Date: Wed, 21 Feb 2024 10:42:01 +0100 Subject: [PATCH 1/2] Start the scheduler 1. Remove the constraint related to Flask for starting the scheduler. --- main.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/main.py b/main.py index fcca57a..c34282e 100644 --- a/main.py +++ b/main.py @@ -405,16 +405,13 @@ def main(): Main function, parse arguments, create a controller and start Flask web server """ set_app() + set_scheduler() + scheduler.start() logger = logging.getLogger() - # Scheduler config - Flask - if os.environ.get("WERKZEUG_RUN_MAIN") == "true": - set_scheduler() - scheduler.start() - logger.info("Will run on %s:%s", HOST, PORT) try: - app.run(host=HOST, port=PORT, debug=DEBUG, threaded=True) + app.run(host=HOST, port=PORT, debug=DEBUG, use_reloader=False, threaded=True) finally: scheduler.stop() From ade9af5e8ed4bc27fa035499ee9b6131808a1ab7 Mon Sep 17 00:00:00 2001 From: Geovanny Gonzalez-Rodriguez Date: Wed, 21 Feb 2024 12:04:32 +0100 Subject: [PATCH 2/2] Remove unused import `os` --- main.py | 1 - 1 file changed, 1 deletion(-) diff --git a/main.py b/main.py index c34282e..d77fb3e 100644 --- a/main.py +++ b/main.py @@ -4,7 +4,6 @@ import logging import json -import os from flask import Flask, send_file, request, make_response from flask_restful import Api from environment import (