-
-
Notifications
You must be signed in to change notification settings - Fork 78
Open
Description
I'm using Procrastinate on my Django application and I have a task that is ran periodically. What I would like to do is also run it when my app starts, after everything is correctly initialized. Something along the lines of @app.on_startup()
I've tried AppConfig.ready() and PROCRASTINATE_ON_APP_READY and both options seems to work, but besides raising a RuntimeWarning for accessing the database during app initialization, both are ran multiple times during the application's life-cycle including every time a worker is started using manage.py, which leads to multiple defers at the same time.
P.S.: Not sure if this is even possible as Django itself doesn't provide a proper way to detect when initialization is done, but would be nice if it was.
Metadata
Metadata
Assignees
Labels
No labels