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