Run the cron scheduler, or no-op if already running.
()
| 224 | |
| 225 | // Run the cron scheduler, or no-op if already running. |
| 226 | func (c *Cron) Run() { |
| 227 | c.runningMu.Lock() |
| 228 | if c.running { |
| 229 | c.runningMu.Unlock() |
| 230 | return |
| 231 | } |
| 232 | c.running = true |
| 233 | c.runningMu.Unlock() |
| 234 | c.run() |
| 235 | } |
| 236 | |
| 237 | // run the scheduler.. this is private just due to the need to synchronize |
| 238 | // access to the 'running' state variable. |