Added pool refill backoff; don't refill pool on .get if ip is blocked

This commit is contained in:
Flowseal
2026-07-28 11:08:24 +03:00
parent a0545cca64
commit 47b8db18d9
2 changed files with 42 additions and 5 deletions
+6 -1
View File
@@ -339,7 +339,11 @@ async def _handle_client(reader, writer, secret: bytes):
ws_timed_out = False
all_redirects = True
ws = await ws_pool.get(dc, is_media, target, domains) if not is_test_dc else None
allow_pool_refill = now >= ip_fail_until.get(target, 0)
ws = await ws_pool.get(
dc, is_media, target, domains,
allow_refill=allow_pool_refill,
) if not is_test_dc else None
if ws:
log.info("[%s] DC%d%s -> pool hit via %s",
label, dc, media_tag, target)
@@ -413,6 +417,7 @@ async def _handle_client(reader, writer, secret: bytes):
dc_fail_until.pop(dc_key, None)
ip_fail_until.pop(target, None)
ws_pool.report_success(dc, is_media)
stats.connections_ws += 1
splitter = None