feat: early abort on LAN

This commit is contained in:
aclist committed 2026-02-17 00:35:33 +09:00
1 parent 7766b4c5c2
commit 59120825dc
3 files changed
+51 -15

No files matched your search

+5 -1
View File
@@ -6,6 +6,7 @@ import re
import requests
import socket
import subprocess
import threading
import typing # noqa
from dataclasses import dataclass
@@ -56,7 +57,10 @@ def get_netmask() -> str:
return netmask
def test_ip(suffix: int, port: int) -> dict | None:
# TODO: rename
def test_ip(suffix: int, port: int, event: threading.Event) -> dict | None:
if event.is_set():
return
netmask = get_netmask()
hostname = f"{netmask}.{str(suffix)}"
ping = ["ping", "-c1", "-i", "0.1", "-w", "1"]