Replies: 1 comment 1 reply
-
|
you can set otherwise, lifespan task will run once in every worker process |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using a lifespan task to do some initialisation stuff when starting the application (e.g. loading a config file and things like that). The code looks like that:
When running reflex locally, this results in the
initfunction to be executed once in the beginning, just as I expect (prints added to the function show up once). However, when running in a Docker setup (based on the production-compose example, the function get's called 25 times, apparently in parallel (prints appear multiple times and are intermingled).Why is it called multiple times in the docker container? How can I avoid that?
Beta Was this translation helpful? Give feedback.
All reactions