back
This commit is contained in:
14
celery_worker.py
Normal file
14
celery_worker.py
Normal file
@@ -0,0 +1,14 @@
|
||||
# This monkey-patching is crucial for eventlet/gevent to work correctly.
|
||||
# It must be done at the very top, before any other modules are imported.
|
||||
import eventlet
|
||||
eventlet.monkey_patch()
|
||||
|
||||
from dotenv import load_dotenv
|
||||
# Load environment variables BEFORE creating the app
|
||||
load_dotenv()
|
||||
|
||||
from app import create_app
|
||||
from celery_app import celery
|
||||
|
||||
app = create_app()
|
||||
app.app_context().push()
|
Reference in New Issue
Block a user