Skip to content

Commit 1089e56

Browse files
committed
Merge branch 'release/0.3.1'
2 parents 7252699 + f12c286 commit 1089e56

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "taskiq-aiohttp"
33
description = "Taskiq integration with AioHTTP framework"
44
authors = ["Taskiq team <taskiq@no-reply.com>"]
55
maintainers = ["Taskiq team <taskiq@no-reply.com>"]
6-
version = "0.3.0"
6+
version = "0.3.1"
77
readme = "README.md"
88
license = "LICENSE"
99
classifiers = [

taskiq_aiohttp/initializer.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,14 @@ async def startup(state: TaskiqState) -> None:
9696

9797
app = import_object(app_path)
9898

99-
if not isinstance(app, web.Application):
99+
if inspect.iscoroutinefunction(app):
100+
app = await app()
101+
elif inspect.isfunction(app):
100102
app = app()
101103

102-
if inspect.iscoroutine(app):
103-
app = await app
104+
if isinstance(app, web.AppRunner):
105+
app = app.app
106+
104107
if not isinstance(app, web.Application):
105108
raise ValueError(f"{app_path} is not an AioHTTP application.")
106109

0 commit comments

Comments
 (0)