Worker: add task failures to the task log as well
Task failures were only placed in the task's activity field, and are now added to the log as well.
This commit is contained in:
parent
e1309ad8fc
commit
7e28cfa69c
@ -81,8 +81,10 @@ func (l *Listener) TaskStarted(ctx context.Context, taskID string) error {
|
||||
|
||||
// TaskFailed tells the Manager the task failed for some reason.
|
||||
func (l *Listener) TaskFailed(ctx context.Context, taskID string, reason string) error {
|
||||
msg := fmt.Sprintf("Failed: %v", reason)
|
||||
return l.sendTaskUpdate(ctx, taskID, api.TaskUpdateJSONRequestBody{
|
||||
Activity: ptr(fmt.Sprintf("Failed: %v", reason)),
|
||||
Activity: &msg,
|
||||
Log: &msg, // Make sure that this failure also ends up in the task log.
|
||||
TaskStatus: ptr(api.TaskStatusFailed),
|
||||
})
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user