mirror of
https://github.com/AstrBotDevs/AstrBot.git
synced 2026-10-16 15:06:04 +08:00
fix: clean up session waiter registrations only once (#10344)
* fix: clean up session waiter registrations only once * Delete tests/unit/test_session_waiter_lifecycle.py --------- Co-authored-by: Soulter <37870767+Soulter@users.noreply.github.com>
This commit is contained in:
@@ -143,10 +143,9 @@ class SessionWaiter:
|
||||
|
||||
try:
|
||||
return await self.session_controller.future
|
||||
except Exception as e:
|
||||
self._cleanup(e)
|
||||
raise e
|
||||
finally:
|
||||
# Clean up once on success, failure, or cancellation. A shared filter
|
||||
# can have another registration that must not be removed twice.
|
||||
self._cleanup()
|
||||
|
||||
def _cleanup(self, error: Exception | None = None) -> None:
|
||||
|
||||
Reference in New Issue
Block a user