From 7850e1f5b4c24a71b21713c905b3aeb77d82f15f Mon Sep 17 00:00:00 2001 From: Flowseal Date: Tue, 7 Apr 2026 23:52:55 +0300 Subject: [PATCH] pool reset on restart --- proxy/tg_ws_proxy.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/proxy/tg_ws_proxy.py b/proxy/tg_ws_proxy.py index 02c8715..5a4bac2 100644 --- a/proxy/tg_ws_proxy.py +++ b/proxy/tg_ws_proxy.py @@ -606,6 +606,10 @@ class _WsPool: self._schedule_refill((dc, is_media), target_ip, domains) log.info("WS pool warmup started for %d DC(s)", len(dc_redirects)) + def reset(self): + self._idle.clear() + self._refilling.clear() + _ws_pool = _WsPool() @@ -1103,6 +1107,7 @@ async def _run(stop_event: Optional[asyncio.Event] = None): global _server_instance, _server_stop_event _server_stop_event = stop_event + _ws_pool.reset() ws_blacklist.clear() dc_fail_until.clear()