From 2f349f7a9c1235918ab8955e13aa0e2d6d4b29c8 Mon Sep 17 00:00:00 2001 From: Christopher Schinnerl Date: Tue, 31 Oct 2023 15:24:50 +0100 Subject: [PATCH] autopilot: fix refill alerts (#703) --- autopilot/accounts.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/autopilot/accounts.go b/autopilot/accounts.go index e659c3c0f..573e75fdf 100644 --- a/autopilot/accounts.go +++ b/autopilot/accounts.go @@ -157,9 +157,10 @@ func (a *accounts) refillWorkerAccounts(w Worker) { defer cancel() accountID, refilled, rerr := refillWorkerAccount(rCtx, a.a, w, workerID, contract) if rerr != nil { - // register the alert on failure - a.ap.RegisterAlert(ctx, newAccountRefillAlert(accountID, contract, *rerr)) if inSet || rerr.Is(errMaxDriftExceeded) { + // register the alert on failure if the contract is in + // the set or the error is errMaxDriftExceeded + a.ap.RegisterAlert(ctx, newAccountRefillAlert(accountID, contract, *rerr)) a.l.Errorw(rerr.err.Error(), rerr.keysAndValues...) } } else {