This commit is contained in:
2025-04-13 22:34:47 -04:00
parent 18b32c8514
commit 593e8960b7
6 changed files with 40 additions and 228 deletions

View File

@ -51,5 +51,11 @@ class BaseScheduler:
async def shutdown(self) -> None:
"""Shutdown the scheduler"""
self.scheduler.shutdown()
logger.info("Scheduler stopped")
try:
self.scheduler.shutdown()
logger.info("Scheduler stopped")
except AttributeError as e:
if "'NoneType' object has no attribute 'call_soon_threadsafe'" in str(e):
logger.warning("Event loop already closed, skipping scheduler shutdown")
else:
raise