cmd/ctrld: ensure error passed to backoff is wrapped in self-check

In commit 670879d1, the backoff is changed to be passed a real error,
instead of a place holder. However, the test query may return a failed
response with a nil error, causing the backoff never fire.

Fixing this by ensuring the error is wrapped, so the backoff always see
a non-nil error.
This commit is contained in:
Cuong Manh Le
2023-05-24 18:53:10 +07:00
committed by Cuong Manh Le
parent d2fc530316
commit 20eae82f11

View File

@@ -890,7 +890,7 @@ func selfCheckStatus(status service.Status) service.Status {
mainLog.Debug().Msgf("self-check against %q succeeded", selfCheckFQDN)
return status
}
bo.BackOff(ctx, err)
bo.BackOff(ctx, fmt.Errorf("ExchangeContext: %w", err))
}
mainLog.Debug().Msgf("self-check against %q failed", selfCheckFQDN)
return service.StatusUnknown