Skip to content

Commit

Permalink
Fix aiohttp example's background task (Fixes #881)
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed Feb 28, 2022
1 parent 342f2e3 commit fb96485
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions examples/server/aiohttp/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ def disconnect(sid):
app.router.add_get('/', index)


if __name__ == '__main__':
async def init_app():
sio.start_background_task(background_task)
web.run_app(app)
return app


if __name__ == '__main__':
web.run_app(init_app())

0 comments on commit fb96485

Please sign in to comment.