mirror of
https://github.com/fromchat-messenger/web.git
synced 2026-09-22 19:15:08 +03:00
Fix the cleanup task
This commit is contained in:
@@ -51,6 +51,14 @@ async def lifespan(app: FastAPI):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Failed to ensure owner verification: {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
|
yield
|
||||||
|
|
||||||
# Shutdown (if needed in the future)
|
# Shutdown (if needed in the future)
|
||||||
|
|||||||
@@ -1344,8 +1344,6 @@ class MessaggingSocketManager:
|
|||||||
self._cleanup_task = asyncio.create_task(self.cleanup_stale_typing_indicators())
|
self._cleanup_task = asyncio.create_task(self.cleanup_stale_typing_indicators())
|
||||||
|
|
||||||
messagingManager = MessaggingSocketManager()
|
messagingManager = MessaggingSocketManager()
|
||||||
# Start the cleanup task
|
|
||||||
messagingManager.start_cleanup_task()
|
|
||||||
|
|
||||||
@router.websocket("/chat/ws")
|
@router.websocket("/chat/ws")
|
||||||
async def chat_websocket(
|
async def chat_websocket(
|
||||||
|
|||||||
Reference in New Issue
Block a user