You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2024/10/3111:18:45INFODailynextRun=2024-10-31T00:00:01.288+08:00err=<nil>2024/10/3111:18:45INFOOneTimenextRun=2024-10-31T11:20:00.000+08:00err=<nil>2024/10/3111:18:47INFODailynextRun=0001-01-01T00:00:00.000Zerr="gocron: job not found"2024/10/3111:18:48INFOOneTimenextRun=0001-01-01T00:00:00.000Zerr="gocron: job not found"2024/10/3111:18:50INFODailynextRun=0001-01-01T00:00:00.000Zerr="gocron: job not found"2024/10/3111:18:51INFOOneTimenextRun=0001-01-01T00:00:00.000Zerr="gocron: job not found"2024/10/3111:18:53INFODailynextRun=0001-01-01T00:00:00.000Zerr="gocron: job not found"2024/10/3111:18:54INFOOneTimenextRun=0001-01-01T00:00:00.000Zerr="gocron: job not found"2024/10/3111:18:56INFODailynextRun=0001-01-01T00:00:00.000Zerr="gocron: job not found"2024/10/3111:18:57INFOOneTimenextRun=0001-01-01T00:00:00.000Zerr="gocron: job not found"2024/10/3111:18:59INFODailynextRun=0001-01-01T00:00:00.000Zerr="gocron: job not found"2024/10/3111:19:00INFOOneTimenextRun=0001-01-01T00:00:00.000Zerr="gocron: job not found"2024/10/3111:19:02INFODailynextRun=0001-01-01T00:00:00.000Zerr="gocron: job not found"2024/10/3111:19:03INFOOneTimenextRun=0001-01-01T00:00:00.000Zerr="gocron: job not found"
Version
Go: 1.23.1
gocron: v2.12.1
Expected behavior
Jobs should not getting not found.
Additional context
I noticed if I change the line:
dailyJob, err := scheduler.NewJob(
- gocron.DailyJob(0, gocron.NewAtTimes(gocron.NewAtTime(0, 0, 1))),+ gocron.DailyJob(1, gocron.NewAtTimes(gocron.NewAtTime(0, 0, 1))),
gocron.NewTask(func() {
slog.Info("Scheduling for a new day", "current", time.Now())
}),
)
Then I would get it worked expectedly:
2024/10/31 11:28:45 INFO Daily nextRun=2024-11-01T00:00:01.196+08:00 err=<nil>
2024/10/31 11:28:45 INFO OneTime nextRun=2024-10-31T11:30:00.000+08:00 err=<nil>
2024/10/31 11:28:46 INFO Daily nextRun=2024-11-01T00:00:01.196+08:00 err=<nil>
2024/10/31 11:28:46 INFO OneTime nextRun=2024-10-31T11:30:00.000+08:00 err=<nil>
2024/10/31 11:28:47 INFO Daily nextRun=2024-11-01T00:00:01.196+08:00 err=<nil>
2024/10/31 11:28:47 INFO OneTime nextRun=2024-10-31T11:30:00.000+08:00 err=<nil>
Is this an expected behavior?
Thanks in advance.
The text was updated successfully, but these errors were encountered:
Describe the bug
When adding a daily job and a one time job, they seem to be overwritten by each other. Please check the PoC below.
To Reproduce
Output:
Version
Go: 1.23.1
gocron: v2.12.1
Expected behavior
Jobs should not getting not found.
Additional context
I noticed if I change the line:
Then I would get it worked expectedly:
Is this an expected behavior?
Thanks in advance.
The text was updated successfully, but these errors were encountered: