1
0
mirror of synced 2026-04-29 22:38:46 +08:00

fix: not selecting

This commit is contained in:
MiyakoMeow
2025-03-03 06:03:17 +08:00
parent 7e2dbb3d45
commit a3026462e5

View File

@@ -38,7 +38,7 @@ def select_ip_from_list(ip_list: List[str]) -> Optional[str]:
if len(ip_list) == 0:
return None
ping_results = [(ip, ping_cached(ip)) for ip in ip_list]
ping_results.sort(lambda x: x[1])
ping_results.sort(key=lambda x: x[1])
best_ip = ping_results[0][0]
print(f"{ping_results}, selected {best_ip}")
return best_ip