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
I'm trying to execute a set of various scripts at a set interval. I found that at times, jobs seem to execute at odd intervals. At first, I though the execution time of each of them would be the root cause but this was not the case. Execution takes less that 1 second.
To Reproduce
Steps to reproduce the behavior:
Create a new scheduler
Register Jobs
Start scheduler
resCh := make(chan Result)
s := gocron.NewScheduler(time.UTC)
for _, script := range scripts {
// script
// "Command": "/usr/local/nagios/libexec/check_linux_disk.pl -p / -w 80 -c 90"
s.Scheduler.Every(seconds).Seconds().Do(script, resCh)
}
s.StartBlocking()
Version
github.com/go-co-op/gocron v1.13.0
Expected behavior
Consistent executions at set intervals
Additional context
Below an example of a job set to run every 60 seconds but skips executions
@zerosoul13 looking into this some, I completely agree there is currently some lag between jobs that can cause a job to occur slightly later than expected. Definitely something we should figure out how to handle better. It's tricky because what's causing the lag is the small amount of compute time between calculating when to run the job next and then running to that time. One idea, is if we had some sort of clock sync / skew check on every job to make sure it's not lagging and then somehow correct.
@zerosoul13 could you test out the master branch when you have a chance and see if it's solved for you? I ran some jobs for several hours and had no drift.
Describe the bug
I'm trying to execute a set of various scripts at a set interval. I found that at times, jobs seem to execute at odd intervals. At first, I though the execution time of each of them would be the root cause but this was not the case. Execution takes less that 1 second.
To Reproduce
Steps to reproduce the behavior:
Version
github.com/go-co-op/gocron v1.13.0
Expected behavior
Consistent executions at set intervals
Additional context
Below an example of a job set to run every 60 seconds but skips executions
The text was updated successfully, but these errors were encountered: