Fix issue cancelling task during cleanup

This commit is contained in:
Mark Backman
2025-01-17 10:33:07 -05:00
parent 15af5e0cd6
commit a4ddf0645f

View File

@@ -106,7 +106,10 @@ class UserIdleProcessor(FrameProcessor):
"""Stops and cleans up the idle monitoring task."""
if self._idle_task is not None:
self._idle_task.cancel()
await self._idle_task
try:
await self._idle_task
except asyncio.CancelledError:
pass # Expected when task is cancelled
self._idle_task = None
async def process_frame(self, frame: Frame, direction: FrameDirection):