feat: decouple OTA updates into dedicated fast endpoints to avoid db timeouts
This commit is contained in:
+5
-2
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user