From 459f44d5e10954b40dcb7a880d096630eb2d2c1c Mon Sep 17 00:00:00 2001 From: Summer <113702628+sum00er@users.noreply.github.com> Date: Tue, 5 Nov 2024 16:45:45 +0800 Subject: [PATCH] Fix minute not working, put back day check --- [core]/cron/server/main.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/[core]/cron/server/main.lua b/[core]/cron/server/main.lua index e3896389..bc8f81d0 100644 --- a/[core]/cron/server/main.lua +++ b/[core]/cron/server/main.lua @@ -17,15 +17,16 @@ function OnTime(time) for i = 1, #Jobs, 1 do local scheduledTimestamp = os.time({ hour = Jobs[i].h, - minute = Jobs[i].m, - second = 0, -- Assuming tasks run at the start of the minute + min = Jobs[i].m, + sec = 0, -- Assuming tasks run at the start of the minute day = os.date("%d", time), month = os.date("%m", time), year = os.date("%Y", time), }) if time >= scheduledTimestamp and (not LastTime or LastTime < scheduledTimestamp) then - Jobs[i].cb(Jobs[i].h, Jobs[i].m) + local d = os.date('*t', scheduledTimestamp).wday + Jobs[i].cb(d, Jobs[i].h, Jobs[i].m) end end end