Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Flask configuration for the scheduler #43

Merged
merged 2 commits into from
Feb 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -405,16 +404,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()

Expand Down
Loading