feat: decouple OTA updates into dedicated fast endpoints to avoid db timeouts

This commit is contained in:
2026-07-11 12:22:48 +08:00
parent bd6ef05722
commit 79ae234232
4 changed files with 26 additions and 12 deletions
+6 -2
View File
@@ -100,8 +100,12 @@ end
local function checkAndApplyUpdate()
if type(CFG) ~= 'table' then return end
local remoteTs = tonumber(CFG.update_counter)
local serverBase = guessBaseFromStatusURL(serverURL)
if #serverBase == 0 then return end
local url = serverBase:gsub("/+$", "") .. "/api/check-update?_t=" .. tostring(nowMs() + math.random(1, 999999))
local ok, data = getJSON(url)
if not ok or not data or not data.update_counter then return end
local remoteTs = tonumber(data.update_counter)
if not remoteTs or remoteTs <= 0 then return end