Skip to content

Commit fb96485

Browse files
Fix aiohttp example's background task (Fixes miguelgrinberg#881)
1 parent 342f2e3 commit fb96485

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

examples/server/aiohttp/app.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ def disconnect(sid):
7878
app.router.add_get('/', index)
7979

8080

81-
if __name__ == '__main__':
81+
async def init_app():
8282
sio.start_background_task(background_task)
83-
web.run_app(app)
83+
return app
84+
85+
86+
if __name__ == '__main__':
87+
web.run_app(init_app())

0 commit comments

Comments
 (0)