Fix the cleanup task

This commit is contained in:
2025-10-22 22:38:15 +03:00
Unverified
parent 1e5099ec90
commit aafc87bb7e
2 changed files with 8 additions and 2 deletions
+8
View File
@@ -51,6 +51,14 @@ async def lifespan(app: FastAPI):
except Exception as e:
logger.error(f"Failed to ensure owner verification: {e}")
# Start the messaging cleanup task
try:
from routes.messaging import messagingManager
messagingManager.start_cleanup_task()
logger.info("Messaging cleanup task started")
except Exception as e:
logger.error(f"Failed to start messaging cleanup task: {e}")
yield
# Shutdown (if needed in the future)
-2
View File
@@ -1344,8 +1344,6 @@ class MessaggingSocketManager:
self._cleanup_task = asyncio.create_task(self.cleanup_stale_typing_indicators())
messagingManager = MessaggingSocketManager()
# Start the cleanup task
messagingManager.start_cleanup_task()
@router.websocket("/chat/ws")
async def chat_websocket(