Skip to content
Snippets Groups Projects
Commit 4430c41a authored by ale's avatar ale
Browse files

ignore tasks that are already final

parent 33835d5f
No related branches found
No related tags found
No related merge requests found
......@@ -37,6 +37,12 @@ func (sm *StateMachine) abortJob(j *task_api.Job, msg string, args ...interface{
}
func (sm *StateMachine) handleJob(j *task_api.Job) {
// Don't fully trust the queue system...
if j.Final {
log.Printf("job %s is already final", j.Id)
return
}
// Find and validate plan and action. If the data is not
// consistent somehow, abort the job with an error.
plan, ok := sm.Plans[j.PlanName]
......@@ -82,6 +88,7 @@ func (sm *StateMachine) handleJob(j *task_api.Job) {
}
// Add a log entry summarizing the transaction.
log.Printf("%s: %s -> %s (%q %q)", j.Id, j.State, nextState, j.Error, j.Final)
j.Log(fmt.Sprintf("%s -> %s", j.State, nextState))
// Set the new job state.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment