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
+5 -2
View File
@@ -690,8 +690,11 @@ local function drawVersionIndicator()
end
local function checkAndApplyUpdate()
if type(CFG) ~= 'table' then return end
local remoteTs = tonumber(CFG.update_counter)
local txt = fetchHTTP(API_BASE .. '/check-update?_t=' .. tostring(os.epoch and os.epoch("utc") or math.random(1, 999999)))
if not txt then return end
local data = jsonDecode(txt)
if 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