-
Notifications
You must be signed in to change notification settings - Fork 170
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
[QUESTION] Repeated task: Multiple executions when using multiple workers #230
Comments
same question here |
+1 |
1 similar comment
+1 |
Maybe this solution can be useful for someone, we can get first process and execute some task only in this process: ------ Background Tasks --------@app.on_event("startup") |
This solution is still valid if we ran fastapi on Kubernetes (with 5 pods for example)? |
This project seems to be dead now. |
Hi @priyanshu-panwar! |
Hi @VladimirMbf |
Hey there,
when i use repeated task in production with a docker gunicorn/uvicorn image there are multiple instances of the application running, each one with the repeated task.
So for example i want to send notifications periodically, the notification will get send multiple times (number of workers)
My workaround for this would be to run a separate container with only one worker, which is then responsible for the repeated task. Is my usecase out of scope or is there a better solution?
best regards,
The text was updated successfully, but these errors were encountered: