Update public source

This commit is contained in:
2026-11-12 20:01:56 +03:00
parent 9e35491e3c
commit c892a96064
2 changed files with 74 additions and 19 deletions
+21
View File
@@ -1645,6 +1645,8 @@ def reports_vendors_update():
"service": service
}
try:
thread = threading.Thread(
target=_run_vendor_update,
args=(
@@ -1656,6 +1658,16 @@ def reports_vendors_update():
thread.start()
except Exception as error:
vendor_update_job["status"] = "error"
vendor_update_job["stage"] = "error"
vendor_update_job["source"] = None
vendor_update_job["message"] = None
vendor_update_job["error"] = str(
error
)
job = dict(
vendor_update_job
)
@@ -1832,6 +1844,8 @@ def reports_vendors_recalculate():
"result": None
}
try:
thread = threading.Thread(
target=_run_vendor_recalculation,
args=(
@@ -1843,6 +1857,13 @@ def reports_vendors_recalculate():
thread.start()
except Exception as error:
vendor_recalc_job["status"] = "error"
vendor_recalc_job["stage"] = "error"
vendor_recalc_job["message"] = None
vendor_recalc_job["error"] = str(error)
job = dict(
vendor_recalc_job
)
+35 -1
View File
@@ -1331,13 +1331,47 @@ class VendorService:
def iter_rows():
last_id = None
while True:
batch = rows_cursor.fetchmany(1000)
if last_id is None:
batch = wifi_conn.execute(
"""
SELECT
id,
bssid,
vendor
FROM access_points
ORDER BY id
LIMIT 1000
"""
).fetchall()
else:
batch = wifi_conn.execute(
"""
SELECT
id,
bssid,
vendor
FROM access_points
WHERE id > ?
ORDER BY id
LIMIT 1000
""",
(
last_id,
)
).fetchall()
if not batch:
break
last_id = batch[-1][0]
yield from batch
placeholders = (