Skip to content
This repository was archived by the owner on Jul 8, 2025. It is now read-only.

Commit ba6afe0

Browse files
authored
Update Flask configuration for the scheduler (#43)
Modify the start-up configuration to don't depend on environment variables to start the scheduler component.
1 parent 8d939cf commit ba6afe0

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

main.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import logging
66
import json
7-
import os
87
from flask import Flask, send_file, request, make_response
98
from flask_restful import Api
109
from environment import (
@@ -405,16 +404,13 @@ def main():
405404
Main function, parse arguments, create a controller and start Flask web server
406405
"""
407406
set_app()
407+
set_scheduler()
408+
scheduler.start()
408409
logger = logging.getLogger()
409410

410-
# Scheduler config - Flask
411-
if os.environ.get("WERKZEUG_RUN_MAIN") == "true":
412-
set_scheduler()
413-
scheduler.start()
414-
415411
logger.info("Will run on %s:%s", HOST, PORT)
416412
try:
417-
app.run(host=HOST, port=PORT, debug=DEBUG, threaded=True)
413+
app.run(host=HOST, port=PORT, debug=DEBUG, use_reloader=False, threaded=True)
418414
finally:
419415
scheduler.stop()
420416

0 commit comments

Comments
 (0)