Skip to content

Commit

Permalink
autopilot: fix refill alerts (#703)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisSchinnerl authored Oct 31, 2023
1 parent 51b3e3b commit 2f349f7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions autopilot/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 2f349f7

Please sign in to comment.