check if it is running when calling start()
@@ -125,8 +125,11 @@ func (c *Cron) Entries() []*Entry {
return c.entrySnapshot()
}
-// Start the cron scheduler in its own go-routine.
+// Start the cron scheduler in its own go-routine, or no-op if already started.
func (c *Cron) Start() {
+ if c.running {
+ return
+ }
c.running = true
go c.run()