Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Fixes #807 - Resets the lastFireTime on a task.Spin()
Browse files Browse the repository at this point in the history
  • Loading branch information
lynxbat committed Mar 25, 2016
1 parent 89e29ab commit eb1c78f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scheduler/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,12 @@ func (t *task) Spin() {
// We need to lock long enough to change state
t.Lock()
defer t.Unlock()
// Reset the lastFireTime at each Spin.
// This ensures misses are tracked only forward of the point
// in time that a task starts spinning. E.g. stopping a task,
// waiting a period of time, and starting the task won't show
// misses for the interval while stopped.
t.lastFireTime = time.Now()
if t.state == core.TaskStopped {
t.state = core.TaskSpinning
t.killChan = make(chan struct{})
Expand Down

0 comments on commit eb1c78f

Please sign in to comment.