Skip to content

Commit

Permalink
Fixed task_status=4 for failed task. for success tasks - task_status=0
Browse files Browse the repository at this point in the history
  • Loading branch information
kochetovd committed Dec 20, 2023
1 parent 6c4ad12 commit 1c65f8f
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions metrics/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,10 @@ func processTask(metrics Metrics, repeaters map[string]MetricsRepeater, logger l
} else {
output["task_exit_code"] = 999
}
output["task_status"] = 4
} else {
output["task_exit_code"] = 0
output["task_status"] = 1
}
output["task_output"] = task_output + stdout.String() + stderr.String()

Expand All @@ -150,14 +152,9 @@ func processTask(metrics Metrics, repeaters map[string]MetricsRepeater, logger l
rollback_exit_code = 0
}
output["task_output"] = task_output + stdout.String() + stderr.String()

output["task_status"] = 4
logger.Println(" * Task with id -", TaskID, "and type id -", TaskTypeID, "rollbacked with code", rollback_exit_code)

} else {
output["task_status"] = 1
logger.Println(" * Task with id -", TaskID, "and type id -", TaskTypeID, "completed with code", output["task_exit_code"])
logger.Println(" * Task rollbacked with code", rollback_exit_code)
}
logger.Println(" * Task with id -", TaskID, "and type id -", TaskTypeID, "completed with code", output["task_exit_code"])

metrics.ReleemAgent.Tasks = output
logger.Debug(output)
Expand All @@ -177,11 +174,12 @@ func processTask(metrics Metrics, repeaters map[string]MetricsRepeater, logger l
} else {
output["task_exit_code"] = 999
}
output["task_status"] = 4
} else {
output["task_exit_code"] = 0
output["task_status"] = 1
}
output["task_output"] = task_output + stderr.String()
output["task_status"] = 1
logger.Println(" * Task with id -", TaskID, "and type id -", TaskTypeID, "completed with code", output["task_exit_code"])

metrics.ReleemAgent.Tasks = output
Expand Down

0 comments on commit 1c65f8f

Please sign in to comment.