Skip to content

Commit

Permalink
fix(server/cron): prevent scheduling tasks for new days
Browse files Browse the repository at this point in the history
From 8488de.
  • Loading branch information
thelindat committed Jul 17, 2023
1 parent 1492130 commit 9c90b5b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions imports/cron/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,13 @@ function OxTask:getNextTime()

if not hour then return end

if minute >= 60 then
minute = 0
hour += 1
end

if hour >= 24 and day then return end

return os.time({
min = minute,
hour = hour,
Expand Down

0 comments on commit 9c90b5b

Please sign in to comment.