-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Deniz Türkmen
authored and
Deniz Türkmen
committed
Oct 23, 2024
1 parent
a823cd4
commit 441cf43
Showing
3 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
|
||
def on_starting(server): | ||
print("Gunicorn master process is starting...") | ||
|
||
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 | ||
|
||
print("Scheduler started in Gunicorn master process") |