MCPcopy
hub / github.com/Runnin4ik/dpi-detector / _one

Function _one

core/telegram_scanner.py:115–123  ·  view source on GitHub ↗
(ip, label)

Source from the content-addressed store, hash-verified

113 lock = asyncio.Lock()
114
115 async def _one(ip, label):
116 nonlocal spin
117 reachable, rtt = await _tcp_ping(ip, TELEGRAM_DC_PORT)
118
119 async with lock:
120 results.append({"ip": ip, "label": label, "reachable": reachable, "rtt": rtt})
121 spin = (spin + 1) % len(_SPIN)
122 ok = sum(1 for x in results if x["reachable"])
123 await display.update(2, f"[dim]{_SPIN[spin]} проверяем {len(results)}/{total} доступно: {ok}[/dim]")
124
125 await asyncio.gather(*[_one(ip, lbl) for ip, lbl in TELEGRAM_DC_IPS])
126

Callers 1

_check_dcFunction · 0.70

Calls 2

_tcp_pingFunction · 0.85
updateMethod · 0.80

Tested by

no test coverage detected