fix by @treeaaa

This commit is contained in:
Quentin Fuxa 2025-09-11 21:03:00 +02:00
parent 2963e8a757
commit 3c11c60126

View file

@ -635,12 +635,13 @@ class AudioProcessor:
except Exception as e: except Exception as e:
logger.error(f"Error in watchdog task: {e}", exc_info=True) logger.error(f"Error in watchdog task: {e}", exc_info=True)
async def cleanup(self): async def cleanup(self):
"""Clean up resources when processing is complete.""" """Clean up resources when processing is complete."""
logger.info("Starting cleanup of AudioProcessor resources.") logger.info("Starting cleanup of AudioProcessor resources.")
for task in self.all_tasks_for_cleanup: self.is_stopping = True
if task and not task.done(): for task in self.all_tasks_for_cleanup:
task.cancel() if task and not task.done():
task.cancel()
created_tasks = [t for t in self.all_tasks_for_cleanup if t] created_tasks = [t for t in self.all_tasks_for_cleanup if t]
if created_tasks: if created_tasks: