From 7e28cfa69c218aab89618d21a739563e821ec3ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 16 Jun 2022 12:22:05 +0200 Subject: [PATCH] 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. --- internal/worker/listener.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/worker/listener.go b/internal/worker/listener.go index c1c50eae..bed90a39 100644 --- a/internal/worker/listener.go +++ b/internal/worker/listener.go @@ -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), }) }