func (s *Scheduler) Stop() { if s.Started { log.Debug("scheduler: Stopping scheduler") s.Cron.Stop() s.Started = false s.Cron = cron.New() // expvars cronInspect.Do(func(kv expvar.KeyValue) { kv.Value = nil }) schedulerStarted.Set("false") } }
func (s *Scheduler) Restart(jobs []*Job) { s.Cron.Stop() s.Cron = cron.New() s.Start(jobs) }
func NewScheduler() *Scheduler { c := cron.New() return &Scheduler{Cron: c, Started: false} }
func NewScheduler() *Scheduler { c := cron.New() schedulerStarted.Set("false") return &Scheduler{Cron: c, Started: false} }