You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When container.init_resources() is called, it is expected that resources are loaded in the same order every time (and ideally in a way that can be controlled, but that is outside the scope of this bug).
What actually happens is the resources are initialized in a random order each time an application is started.
This is due to def traverse(...) using set() to iterate over the providers, this results in a random start-up order every time an app is restarted.
Proposed short-term solution is to init providers in the order they are defined in the container.
Proposed long-term solution (separate ticket / feature request) is that providers can be given a "priority" or "order" to indicate precedence.
The text was updated successfully, but these errors were encountered:
Another point is why the lib doesn't init the resources automatically when they are presented as dependency. Initing all the resources at once is a waste of resources.
When
container.init_resources()
is called, it is expected that resources are loaded in the same order every time (and ideally in a way that can be controlled, but that is outside the scope of this bug).What actually happens is the resources are initialized in a random order each time an application is started.
This is due to
def traverse(...)
usingset()
to iterate over the providers, this results in a random start-up order every time an app is restarted.Proposed short-term solution is to init providers in the order they are defined in the container.
Proposed long-term solution (separate ticket / feature request) is that providers can be given a "priority" or "order" to indicate precedence.
The text was updated successfully, but these errors were encountered: