Don't log when repo-updater shuts down (#62121)

This should reduce some sentry error reporting for non-actionable errors.

Test plan:

Will see if sentry is more silent.
This commit is contained in:
Erik Seliger 2024-04-25 02:04:20 +02:00 committed by GitHub
parent 366e020552
commit 166b416909
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -190,8 +190,8 @@ func (s *UpdateScheduler) runUpdateLoop(ctx context.Context) {
} else {
schedError.WithLabelValues("repoUpdateResponse").Inc()
// We don't want to spam our logs when the rate limiter has been set to block all
// updates
if !strings.Contains(err.Error(), ratelimit.ErrBlockAll.Error()) {
// updates, or when repo-updater is shutting down.
if !strings.Contains(err.Error(), ratelimit.ErrBlockAll.Error()) && ctx.Err() == nil {
subLogger.Error("error updating repo", log.Error(err), log.String("uri", string(repo.Name)))
}
}