harmony: Fix tx error wrap/retry in AddTask

This commit is contained in:
Łukasz Magiera 2024-01-12 17:01:26 +01:00
parent e06cfa2d0a
commit b84e8d0fe9

View File

@ -36,7 +36,7 @@ retryAddTask:
} }
err = tx.QueryRow("SELECT id FROM harmony_task ORDER BY update_time DESC LIMIT 1").Scan(&tID) err = tx.QueryRow("SELECT id FROM harmony_task ORDER BY update_time DESC LIMIT 1").Scan(&tID)
if err != nil { 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) return extra(tID, tx)
}) })
@ -51,7 +51,7 @@ retryAddTask:
retryWait *= 2 retryWait *= 2
goto retryAddTask 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 return
} }
} }