We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a25df7d + cad3a51 commit 87387d1Copy full SHA for 87387d1
1 file changed
taskiq_aiohttp/initializer.py
@@ -96,11 +96,14 @@ async def startup(state: TaskiqState) -> None:
96
97
app = import_object(app_path)
98
99
- if not isinstance(app, web.Application):
+ if inspect.iscoroutinefunction(app):
100
+ app = await app()
101
+ elif inspect.isfunction(app):
102
app = app()
103
- if inspect.iscoroutine(app):
- app = await app
104
+ if isinstance(app, web.AppRunner):
105
+ app = app.app
106
+
107
if not isinstance(app, web.Application):
108
raise ValueError(f"{app_path} is not an AioHTTP application.")
109
0 commit comments