Skip to content

Commit

Permalink
add additional flag to disable transfering feedback between app and s…
Browse files Browse the repository at this point in the history
…erver
  • Loading branch information
jueri committed Nov 15, 2024
1 parent 44cfb37 commit a7156ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions web/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class Config:
SESSION_EXPIRATION = int(SESSION_EXPIRATION)
INTERVAL_DB_CHECK = os.environ.get("INTERVAL_DB_CHECK") or 3 # seconds
INTERVAL_DB_CHECK = int(INTERVAL_DB_CHECK)

SENDFEEDBACK = False if os.environ.get("SENDFEEDBACK") == "False" else True # Opt out
DELETE_SENT_SESSION = (
True if os.environ.get("DELETE_SENT_SESSION") == "True" else False
)
Expand Down
7 changes: 4 additions & 3 deletions web/gunicorn.conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ def when_ready(server):
from app.app import create_app, scheduler
app = create_app() # Create an instance of the app
with app.app_context():
print("Initializing and starting scheduler inside Gunicorn master process")
scheduler.init_app(app) # Initialize the scheduler
scheduler.start() # Start the scheduler
if app.config["SENDFEEDBACK"]:
print("Initializing and starting scheduler inside Gunicorn master process")
scheduler.init_app(app) # Initialize the scheduler
scheduler.start() # Start the scheduler

print("Scheduler started in Gunicorn master process")

0 comments on commit a7156ee

Please sign in to comment.