SetInterval changes the current cron tick interval (it usually should be >= 1 minute).
(d time.Duration)
| 46 | // SetInterval changes the current cron tick interval |
| 47 | // (it usually should be >= 1 minute). |
| 48 | func (c *Cron) SetInterval(d time.Duration) { |
| 49 | // update interval |
| 50 | c.mux.Lock() |
| 51 | wasStarted := c.ticker != nil |
| 52 | c.interval = d |
| 53 | c.mux.Unlock() |
| 54 | |
| 55 | // restart the ticker |
| 56 | if wasStarted { |
| 57 | c.Start() |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | // SetTimezone changes the current cron tick timezone. |
| 62 | func (c *Cron) SetTimezone(l *time.Location) { |