Update public source

This commit is contained in:
2026-11-16 18:31:52 +03:00
parent f7d78c0ea6
commit 34857e8ed2
2 changed files with 213 additions and 12 deletions
+21 -12
View File
@@ -291,17 +291,21 @@ scanner_output = deque(
scanner_lock = threading.Lock()
scanner_output_thread = None
vendor_previews = {}
vendor_preview_lock = threading.Lock()
vendor_update_job = None
vendor_update_thread = None
vendor_update_lock = threading.Lock()
vendor_operation_lock = threading.Lock()
vendor_recalc_job = None
vendor_recalc_thread = None
vendor_recalc_lock = threading.Lock()
@@ -309,6 +313,9 @@ gps_test_service = None
gps_test_lock = threading.Lock()
sudo_keepalive_stop_event = threading.Event()
sudo_keepalive_thread = None
wifi_connection_service = WiFiConnectionService()
def check_sudo():
@@ -335,13 +342,11 @@ def check_sudo():
return result.returncode == 0
def sudo_keepalive():
def sudo_keepalive(stop_event):
checker = SudoChecker()
while True:
time.sleep(60)
while not stop_event.wait(60):
checker.refresh()
@@ -1582,6 +1587,7 @@ def _run_vendor_update(
def reports_vendors_update():
global vendor_update_job
global vendor_update_thread
config = read_config()
@@ -1647,7 +1653,7 @@ def reports_vendors_update():
try:
thread = threading.Thread(
vendor_update_thread = threading.Thread(
target=_run_vendor_update,
args=(
job_id,
@@ -1656,7 +1662,7 @@ def reports_vendors_update():
daemon=True
)
thread.start()
vendor_update_thread.start()
except Exception as error:
@@ -1791,6 +1797,7 @@ def _run_vendor_recalculation(
def reports_vendors_recalculate():
global vendor_recalc_job
global vendor_recalc_thread
config = read_config()
@@ -1846,7 +1853,7 @@ def reports_vendors_recalculate():
try:
thread = threading.Thread(
vendor_recalc_thread = threading.Thread(
target=_run_vendor_recalculation,
args=(
job_id,
@@ -1855,7 +1862,7 @@ def reports_vendors_recalculate():
daemon=True
)
thread.start()
vendor_recalc_thread.start()
except Exception as error:
@@ -3386,6 +3393,7 @@ def config_save():
def scanner_start():
global scanner_process
global scanner_output_thread
global scanner_health
global scanner_stopped_at
global scanner_starting
@@ -3536,13 +3544,13 @@ def scanner_start():
)
thread = threading.Thread(
scanner_output_thread = threading.Thread(
target=read_scanner_output,
args=(process,),
daemon=True
)
thread.start()
scanner_output_thread.start()
return redirect(
@@ -3619,12 +3627,13 @@ if __name__ == "__main__":
)
thread = threading.Thread(
sudo_keepalive_thread = threading.Thread(
target=sudo_keepalive,
args=(sudo_keepalive_stop_event,),
daemon=True
)
thread.start()
sudo_keepalive_thread.start()
logging.getLogger("werkzeug").disabled = True