fix(gate): use unique cache busting file names again to break any potential loop
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
local DEFAULT_SERVER_BASE = "http://ticket.fse-media.group"
|
local DEFAULT_SERVER_BASE = "http://ticket.fse-media.group"
|
||||||
local DEFAULT_SERVER_PATH = "/api/tickets/check"
|
local DEFAULT_SERVER_PATH = "/api/tickets/check"
|
||||||
local GATE_OPEN_SECONDS = 2
|
local GATE_OPEN_SECONDS = 2
|
||||||
local VERSION = "v1.5.21"
|
local VERSION = "v1.5.22"
|
||||||
local VERSION_CHECK_INTERVAL = 5
|
local VERSION_CHECK_INTERVAL = 5
|
||||||
|
|
||||||
local serverURL = nil
|
local serverURL = nil
|
||||||
@@ -1465,7 +1465,7 @@ local function checkAndApplyUpdate()
|
|||||||
|
|
||||||
if not remoteTs or remoteTs <= 0 then return end
|
if not remoteTs or remoteTs <= 0 then return end
|
||||||
|
|
||||||
local attemptFile = ".last_update_ts_gate"
|
local attemptFile = ".last_update_ts_gate2"
|
||||||
if fs.exists(attemptFile) then
|
if fs.exists(attemptFile) then
|
||||||
local f = fs.open(attemptFile, "r")
|
local f = fs.open(attemptFile, "r")
|
||||||
local tried = tonumber(f and f.readAll() or "0") or 0
|
local tried = tonumber(f and f.readAll() or "0") or 0
|
||||||
@@ -1495,6 +1495,7 @@ local function checkAndApplyUpdate()
|
|||||||
print("OTA Update Error: " .. tostring(res))
|
print("OTA Update Error: " .. tostring(res))
|
||||||
term.setTextColor(colors.white)
|
term.setTextColor(colors.white)
|
||||||
end
|
end
|
||||||
|
sleep(3)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
lastUpdateError = "loadfile failed: " .. tostring(err)
|
lastUpdateError = "loadfile failed: " .. tostring(err)
|
||||||
@@ -1503,6 +1504,7 @@ local function checkAndApplyUpdate()
|
|||||||
print("OTA Update Error: " .. tostring(err))
|
print("OTA Update Error: " .. tostring(err))
|
||||||
term.setTextColor(colors.white)
|
term.setTextColor(colors.white)
|
||||||
end
|
end
|
||||||
|
sleep(3)
|
||||||
end
|
end
|
||||||
|
|
||||||
isUpdating = false
|
isUpdating = false
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
local VERSION = "v1.5.21"
|
local VERSION = "v1.5.22"
|
||||||
local MACHINE_SIDE = "bottom"
|
local MACHINE_SIDE = "bottom"
|
||||||
local PAYMENT_SIDE = "right"
|
local PAYMENT_SIDE = "right"
|
||||||
local PRESET_AMOUNTS = { 5, 10, 15, 20 }
|
local PRESET_AMOUNTS = { 5, 10, 15, 20 }
|
||||||
|
|||||||
+4
-2
@@ -1,6 +1,6 @@
|
|||||||
local CURRENT_STATION_CODE = 'Ticket-Machine'
|
local CURRENT_STATION_CODE = 'Ticket-Machine'
|
||||||
local API_BASE = 'http://ticket.fse-media.group/api'
|
local API_BASE = 'http://ticket.fse-media.group/api'
|
||||||
local VERSION = 'v1.5.21'
|
local VERSION = 'v1.5.22'
|
||||||
local UPDATE_CHECK_INTERVAL = 5
|
local UPDATE_CHECK_INTERVAL = 5
|
||||||
|
|
||||||
-- ###########################
|
-- ###########################
|
||||||
@@ -695,7 +695,7 @@ local function checkAndApplyUpdate()
|
|||||||
|
|
||||||
if not remoteTs or remoteTs <= 0 then return end
|
if not remoteTs or remoteTs <= 0 then return end
|
||||||
|
|
||||||
local attemptFile = ".last_update_ts"
|
local attemptFile = ".last_update_ts2"
|
||||||
if fs.exists(attemptFile) then
|
if fs.exists(attemptFile) then
|
||||||
local f = fs.open(attemptFile, "r")
|
local f = fs.open(attemptFile, "r")
|
||||||
local tried = tonumber(f and f.readAll() or "0") or 0
|
local tried = tonumber(f and f.readAll() or "0") or 0
|
||||||
@@ -722,6 +722,7 @@ local function checkAndApplyUpdate()
|
|||||||
print("OTA Update Error: " .. tostring(res))
|
print("OTA Update Error: " .. tostring(res))
|
||||||
term.setTextColor(colors.white)
|
term.setTextColor(colors.white)
|
||||||
end
|
end
|
||||||
|
sleep(3)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
lastUpdateError = "loadfile failed: " .. tostring(err)
|
lastUpdateError = "loadfile failed: " .. tostring(err)
|
||||||
@@ -730,6 +731,7 @@ local function checkAndApplyUpdate()
|
|||||||
print("OTA Update Error: " .. tostring(err))
|
print("OTA Update Error: " .. tostring(err))
|
||||||
term.setTextColor(colors.white)
|
term.setTextColor(colors.white)
|
||||||
end
|
end
|
||||||
|
sleep(3)
|
||||||
end
|
end
|
||||||
|
|
||||||
isUpdating = false
|
isUpdating = false
|
||||||
|
|||||||
Reference in New Issue
Block a user