Skip to content

[Bug] Cron - Day ahead or more cron doesn't run #77

@FingerlessGlov3s

Description

@FingerlessGlov3s

Describe the bug
We had an issue in the cron, we had a timer set to run on Jan 1st 00:00 but when the time came and we went from Dec 31st 23:59 to Jan 1st 00:00, the cron didn't run.

I spent a little bit of time investigating and I noticed if the cron is set to run another day, it doesn't get scheduled unless it's applicable for the current day, so if you schedule something for say tomorrow at 4am, and the fxserver booted the day before, far as I can tell when it runs the getNextTime no time is then returned and the cron is stopped

lib.cron.new('0 0 01 01 *', function() Reset() end)
lib.cron.new('0 0 01 04 *', function() Reset() end)
lib.cron.new('0 0 01 07 *', function() Reset() end)
lib.cron.new('0 0 01 10 *', function() Reset() end)

FXServer started at 31st Dec 2025 16:00

Framework
ESX

Resource version
v3.32.2

To Reproduce
Set a cron entry to run the next day eg 30 1 06 01 * the getNextTime function returns no next time

Expected behavior
Cron should wait for this time as expected

Screenshots
My Debug screenshot, as you can see it returns on the day check in getNextTime rather than the future epoch
Image

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions