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)
| 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. |
| 14 | func 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. |
no outgoing calls
searching dependent graphs…