diff --git a/rtmc.lua b/rtmc.lua index 146919e..0e58148 100644 --- a/rtmc.lua +++ b/rtmc.lua @@ -364,10 +364,10 @@ rawset(__BUNDLER_FILES, "updater.lua", function () end function updater:check(branch) local curr = os.time(); - if (math.abs(curr - self.last_check) >= self.threshold) and (self.curr_commit_hash ~= "") then - self.last_check = curr; - return true; + if not ((math.abs(curr - self.last_check) >= self.threshold) and (self.curr_commit_hash ~= "")) then + return false; end + self.last_check = curr; local req, rerr = http.get(self.api_url .. "/commits?sha="..branch); if not req then log.error("Updater:check: Could not send request: " .. rerr); diff --git a/src/updater.lua b/src/updater.lua index 198c723..da0bb8c 100644 --- a/src/updater.lua +++ b/src/updater.lua @@ -50,10 +50,10 @@ end function updater:check(branch) local curr = os.time(); - if (math.abs(curr - self.last_check) >= self.threshold) and (self.curr_commit_hash ~= "") then - self.last_check = curr; - return true; + if not ((math.abs(curr - self.last_check) >= self.threshold) and (self.curr_commit_hash ~= "")) then + return false; end + self.last_check = curr; local req, rerr = http.get(self.api_url .. "/commits?sha="..branch); if not req then