Решение проблемы обработки sigterm

This commit is contained in:
Alexey Polyakov
2026-05-06 15:25:07 +03:00
parent 0f2d946b98
commit 613e1b96cd
3 changed files with 33 additions and 4 deletions

View File

@@ -1,6 +1,7 @@
import logging
import traceback
import websockets
import asyncio
from common.proto_web import WebProto
from tamtam.processors import Processors
from common.rate_limiter import RateLimiter
@@ -229,4 +230,9 @@ class TamTamWS:
self.logger.info(f"TT WebSocket запущен на порту {self.port}")
await self.server.wait_closed()
try:
await self.server.wait_closed()
except asyncio.CancelledError:
self.server.close()
await self.server.wait_closed()
raise