From b84e8d0fe9a40083a37b446b23821c50e9e88dfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Fri, 12 Jan 2024 17:01:26 +0100 Subject: [PATCH] harmony: Fix tx error wrap/retry in AddTask --- lib/harmony/harmonytask/task_type_handler.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/harmony/harmonytask/task_type_handler.go b/lib/harmony/harmonytask/task_type_handler.go index 0a25fc507..93418ba28 100644 --- a/lib/harmony/harmonytask/task_type_handler.go +++ b/lib/harmony/harmonytask/task_type_handler.go @@ -36,7 +36,7 @@ retryAddTask: } err = tx.QueryRow("SELECT id FROM harmony_task ORDER BY update_time DESC LIMIT 1").Scan(&tID) if err != nil { - return false, fmt.Errorf("Could not select ID: %v", err) + return false, fmt.Errorf("Could not select ID: %w", err) } return extra(tID, tx) }) @@ -51,7 +51,7 @@ retryAddTask: retryWait *= 2 goto retryAddTask } - log.Error("Could not add task. AddTasFunc failed: %v", err) + log.Errorw("Could not add task. AddTasFunc failed", "error", err, "type", h.Name) return } }