MCPcopy
hub / github.com/robfig/cron / Every

Function Every

constantdelay.go:14–21  ·  view source on GitHub ↗

Every returns a crontab Schedule that activates once every duration. Delays of less than a second are not supported (will round up to 1 second). Any fields less than a Second are truncated.

(duration time.Duration)

Source from the content-addressed store, hash-verified

12// Delays of less than a second are not supported (will round up to 1 second).
13// Any fields less than a Second are truncated.
14func Every(duration time.Duration) ConstantDelaySchedule {
15 if duration < time.Second {
16 duration = time.Second
17 }
18 return ConstantDelaySchedule{
19 Delay: duration - time.Duration(duration.Nanoseconds())%time.Second,
20 }
21}
22
23// Next returns the next time this should be run.
24// This rounds so that the next activation time will be on the second.

Callers 5

TestConstantDelayNextFunction · 0.85
parseDescriptorFunction · 0.85
TestJobFunction · 0.85
TestScheduleAfterRemovalFunction · 0.85

Calls

no outgoing calls

Tested by 4

TestConstantDelayNextFunction · 0.68
TestJobFunction · 0.68
TestScheduleAfterRemovalFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…