Update public source
This commit is contained in:
+39
-18
@@ -1645,16 +1645,28 @@ def reports_vendors_update():
|
||||
"service": service
|
||||
}
|
||||
|
||||
thread = threading.Thread(
|
||||
target=_run_vendor_update,
|
||||
args=(
|
||||
job_id,
|
||||
service
|
||||
),
|
||||
daemon=True
|
||||
)
|
||||
try:
|
||||
|
||||
thread.start()
|
||||
thread = threading.Thread(
|
||||
target=_run_vendor_update,
|
||||
args=(
|
||||
job_id,
|
||||
service
|
||||
),
|
||||
daemon=True
|
||||
)
|
||||
|
||||
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,16 +1844,25 @@ def reports_vendors_recalculate():
|
||||
"result": None
|
||||
}
|
||||
|
||||
thread = threading.Thread(
|
||||
target=_run_vendor_recalculation,
|
||||
args=(
|
||||
job_id,
|
||||
service
|
||||
),
|
||||
daemon=True
|
||||
)
|
||||
try:
|
||||
|
||||
thread.start()
|
||||
thread = threading.Thread(
|
||||
target=_run_vendor_recalculation,
|
||||
args=(
|
||||
job_id,
|
||||
service
|
||||
),
|
||||
daemon=True
|
||||
)
|
||||
|
||||
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
@@ -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 = (
|
||||
|
||||
Reference in New Issue
Block a user