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
Hi, the issue is that warmup_container is a regular function and your create_pg_pool resource is an async one so it cannot be created from the warmup_container call. The fix you did works because the autowired get_pg_client is also async and as such wireup can await for pg pool.
#45 is precisely about this. To have an async verison of warmup_container use cases where underlying resources may be async factories. In your case I'd just remove the call to warmup_container and let the container create it when necessary.
Hello, I have created an async iterator for running transactions, here are the services involved:
pg_client.py
Then to instantiate in fastapi applicaiton I call
container.warmup()
in lifespan like soThis throws
wireup.errors.WireupError: Cannot construct async objects fron a non-async context.
errorI managed to workaround it by awaiting for pg_client explicitly, like so
However not sure if it's smth with the lib or I am just doing smth wrong
The text was updated successfully, but these errors were encountered: