Start the cron scheduler in its own goroutine, or no-op if already started.
()
| 213 | |
| 214 | // Start the cron scheduler in its own goroutine, or no-op if already started. |
| 215 | func (c *Cron) Start() { |
| 216 | c.runningMu.Lock() |
| 217 | defer c.runningMu.Unlock() |
| 218 | if c.running { |
| 219 | return |
| 220 | } |
| 221 | c.running = true |
| 222 | go c.run() |
| 223 | } |
| 224 | |
| 225 | // Run the cron scheduler, or no-op if already running. |
| 226 | func (c *Cron) Run() { |