From adf72533506fc2455a2626bc7226c6ee14d2c576 Mon Sep 17 00:00:00 2001 From: MinhNN86 Date: Tue, 10 Mar 2026 18:10:43 +0700 Subject: [PATCH] fix bug scan ip (win) --- core/scanner.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/scanner.py b/core/scanner.py index 8b2c9e5..22b6477 100644 --- a/core/scanner.py +++ b/core/scanner.py @@ -12,10 +12,10 @@ def _ping_one(ip, is_win): try: if is_win: r = subprocess.run( - ["ping", "-n", "1", "-w", "300", str(ip)], + ["ping", "-n", "1", "-w", "500", str(ip)], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, - timeout=2, + timeout=3, creationflags=_NO_WINDOW ) elif sys.platform == "darwin": @@ -59,7 +59,7 @@ def _ping_sweep(network, progress_cb=None): progress_cb(done_count[0], total) return (str(ip), ok) - with ThreadPoolExecutor(max_workers=len(hosts)) as executor: + with ThreadPoolExecutor(max_workers=min(64, len(hosts))) as executor: futures = [executor.submit(_ping_and_track, ip) for ip in hosts] for f in as_completed(futures): ip_str, ok = f.result()