mirror of
https://github.com/kemko/nomad.git
synced 2026-01-08 11:25:41 +03:00
Fix restart attempts of restart stanza.
Number of restarts during 2nd interval is off by one.
This commit is contained in:
@@ -169,8 +169,6 @@ func (r *RestartTracker) GetState() (string, time.Duration) {
|
||||
return structs.TaskNotRestarting, 0
|
||||
}
|
||||
|
||||
r.count++
|
||||
|
||||
// Check if we have entered a new interval.
|
||||
end := r.startTime.Add(r.policy.Interval)
|
||||
now := time.Now()
|
||||
@@ -179,6 +177,8 @@ func (r *RestartTracker) GetState() (string, time.Duration) {
|
||||
r.startTime = now
|
||||
}
|
||||
|
||||
r.count++
|
||||
|
||||
// Handle restarts due to failures
|
||||
if !r.failure {
|
||||
return "", 0
|
||||
|
||||
Reference in New Issue
Block a user