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 00b358553d
commit 357a10bcf4

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