mirror of
https://github.com/TangentFoxy/itchy.git
synced 2024-11-25 15:24:20 +00:00
fixed typoes/errors w new table system
This commit is contained in:
parent
ad2c1c586b
commit
2789379c1d
10
check.lua
10
check.lua
@ -26,7 +26,7 @@ check = function(data)
|
|||||||
result.body, result.status = http.request(tostring(data.proxy) .. "/get/https://itch.io/api/1/x/wharf/latest?target=" .. tostring(data.target) .. "&channel_name=" .. tostring(data.channel))
|
result.body, result.status = http.request(tostring(data.proxy) .. "/get/https://itch.io/api/1/x/wharf/latest?target=" .. tostring(data.target) .. "&channel_name=" .. tostring(data.channel))
|
||||||
end
|
end
|
||||||
if not (result.body) then
|
if not (result.body) then
|
||||||
result.message = "socket.http.request error: " .. tostring(status)
|
result.message = "socket.http.request error: " .. tostring(result.status)
|
||||||
send:push(result)
|
send:push(result)
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
@ -35,15 +35,15 @@ check = function(data)
|
|||||||
if data.version then
|
if data.version then
|
||||||
result.latest = result.version == data.version
|
result.latest = result.version == data.version
|
||||||
end
|
end
|
||||||
if status ~= 200 and (not version) then
|
if result.status ~= 200 and (not result.version) then
|
||||||
result.message = "unknown, error getting latest version: HTTP " .. tostring(status) .. ", trying again in " .. tostring(exponential_backoff) .. " seconds"
|
result.message = "unknown, error getting latest version: HTTP " .. tostring(result.status) .. ", trying again in " .. tostring(exponential_backoff) .. " seconds"
|
||||||
send:push(result)
|
send:push(result)
|
||||||
timer.sleep(exponential_backoff)
|
timer.sleep(exponential_backoff)
|
||||||
exponential_backoff = exponential_backoff * 2
|
exponential_backoff = exponential_backoff * 2
|
||||||
_continue_0 = true
|
_continue_0 = true
|
||||||
break
|
break
|
||||||
elseif latest ~= nil then
|
elseif result.latest ~= nil then
|
||||||
if latest then
|
if result.latest then
|
||||||
result.message = tostring(result.version) .. ", you have the latest version"
|
result.message = tostring(result.version) .. ", you have the latest version"
|
||||||
else
|
else
|
||||||
result.message = tostring(result.version) .. ", there is a newer version available!"
|
result.message = tostring(result.version) .. ", there is a newer version available!"
|
||||||
|
@ -34,8 +34,8 @@ check = (data) ->
|
|||||||
timer.sleep exponential_backoff
|
timer.sleep exponential_backoff
|
||||||
exponential_backoff *= 2
|
exponential_backoff *= 2
|
||||||
continue
|
continue
|
||||||
elseif latest != nil
|
elseif result.latest != nil
|
||||||
if latest
|
if result.latest
|
||||||
result.message = "#{result.version}, you have the latest version"
|
result.message = "#{result.version}, you have the latest version"
|
||||||
else
|
else
|
||||||
result.message = "#{result.version}, there is a newer version available!"
|
result.message = "#{result.version}, there is a newer version available!"
|
||||||
|
Loading…
Reference in New Issue
Block a user