Always capture the finish time

This commit is contained in:
Alex Dadgar 2018-03-29 11:21:50 -07:00 committed by Alex Dadgar
parent 4338360da9
commit beee130a6e
1 changed files with 2 additions and 5 deletions

View File

@ -715,11 +715,8 @@ func (r *AllocRunner) setTaskState(taskName, state string, event *structs.TaskEv
}
}
case structs.TaskStateDead:
// Capture the finished time. If it has never started there is no finish
// time
if !taskState.StartedAt.IsZero() {
taskState.FinishedAt = time.Now().UTC()
}
// Capture the finished time.
taskState.FinishedAt = time.Now().UTC()
// Find all tasks that are not the one that is dead and check if the one
// that is dead is a leader