Skip to content

Commit

Permalink
Change scheduler_started expvar to int to be parseable
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Castell committed Jan 17, 2019
1 parent 723c1e8 commit a509cce
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions dkron/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import (
"errors"
"expvar"

"github.com/sirupsen/logrus"
"github.com/armon/go-metrics"
"github.com/sirupsen/logrus"
"github.com/victorcoder/dkron/cron"
)

var (
cronInspect = expvar.NewMap("cron_entries")
schedulerStarted = expvar.NewString("scheduler_started")
schedulerStarted = expvar.NewInt("scheduler_started")

ErrScheduleParse = errors.New("Can't parse job schedule")
)
Expand All @@ -33,7 +33,7 @@ type Scheduler struct {

func NewScheduler() *Scheduler {
c := cron.New()
schedulerStarted.Set("false")
schedulerStarted.Set(1)
return &Scheduler{Cron: c, Started: false}
}

Expand All @@ -60,7 +60,7 @@ func (s *Scheduler) Start(jobs []*Job) {
s.Cron.Start()
s.Started = true

schedulerStarted.Set("true")
schedulerStarted.Set(1)
}

func (s *Scheduler) Stop() {
Expand All @@ -74,7 +74,7 @@ func (s *Scheduler) Stop() {
cronInspect.Do(func(kv expvar.KeyValue) {
kv.Value = nil
})
schedulerStarted.Set("false")
schedulerStarted.Set(0)
}
}

Expand Down

0 comments on commit a509cce

Please sign in to comment.