This commit is contained in:
Gvidas Juknevičius 2024-08-25 22:39:46 +03:00
parent 4161160ab6
commit f41e343970
Signed by: MCorange
GPG Key ID: 12B1346D720B7FBB
2 changed files with 3 additions and 4 deletions

View File

@ -342,7 +342,7 @@ rawset(__BUNDLER_FILES, "updater", function ()
function updater.new() function updater.new()
local c = setmetatable({}, updater); local c = setmetatable({}, updater);
c.last_check = os.time(); c.last_check = os.time();
c.threshold = ((20*60)/24/60) * 5; c.threshold = ((20*60)/24/60/60) * 5;
c.api_url = "https://git.mcorangehq.xyz/api/v1/repos/xomf/keypadOS"; c.api_url = "https://git.mcorangehq.xyz/api/v1/repos/xomf/keypadOS";
c.curr_commit_hash = ""; c.curr_commit_hash = "";
c.updated_files = {}; c.updated_files = {};
@ -372,7 +372,6 @@ rawset(__BUNDLER_FILES, "updater", function ()
function updater:check(branch) function updater:check(branch)
local curr = os.time(); local curr = os.time();
if not ((math.abs(curr - self.last_check) >= self.threshold) and (self.curr_commit_hash ~= "")) then if not ((math.abs(curr - self.last_check) >= self.threshold) and (self.curr_commit_hash ~= "")) then
log.debug("Not time for an update yet");
return false; return false;
end end
self.last_check = curr; self.last_check = curr;

View File

@ -18,7 +18,7 @@ updater.__index = updater;
function updater.new() function updater.new()
local c = setmetatable({}, updater); local c = setmetatable({}, updater);
c.last_check = os.time(); c.last_check = os.time();
c.threshold = ((20*60)/24/60) * 5; c.threshold = ((20*60)/24/60/60) * 5;
c.api_url = "https://git.mcorangehq.xyz/api/v1/repos/xomf/keypadOS"; c.api_url = "https://git.mcorangehq.xyz/api/v1/repos/xomf/keypadOS";
c.curr_commit_hash = ""; c.curr_commit_hash = "";
c.updated_files = {}; c.updated_files = {};
@ -51,7 +51,7 @@ end
function updater:check(branch) function updater:check(branch)
local curr = os.time(); local curr = os.time();
if not ((math.abs(curr - self.last_check) >= self.threshold) and (self.curr_commit_hash ~= "")) then if not ((math.abs(curr - self.last_check) >= self.threshold) and (self.curr_commit_hash ~= "")) then
log.debug("Not time for an update yet"); -- log.debug("Not time for an update yet");
return false; return false;
end end
self.last_check = curr; self.last_check = curr;