diff options
-rw-r--r-- | internal/source/gitlab/cache/retriever.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/source/gitlab/cache/retriever.go b/internal/source/gitlab/cache/retriever.go index 65c7f1a2..68299f6c 100644 --- a/internal/source/gitlab/cache/retriever.go +++ b/internal/source/gitlab/cache/retriever.go @@ -78,6 +78,11 @@ func (r *Retriever) resolveWithBackoff(ctx context.Context, domainName string) < break } + if errors.Is(lookup.Error, context.Canceled) || errors.Is(lookup.Error, context.DeadlineExceeded) { + // do not retry if there's a context error to avoid leaking the goroutine + break + } + time.Sleep(r.maxRetrievalInterval) } |