Quart: Keep a single ClientSession
Previously, each instance of AsyncContext created its own aiohttp ClientSession to send requests to Discord. However, it was unclear when to close this session, as background tasks could continue to make use of it after the initial response had been sent.
This release uses a ClientSession stored at the application level instead. This session is created using @app.before_serving
and closed using @app.after_serving
automatically for Quart apps. This is handled within app.set_route_async
.
This release deprecates AsyncContext.close()
.