Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'internal/source/gitlab/cache/retriever.go')
-rw-r--r--internal/source/gitlab/cache/retriever.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/internal/source/gitlab/cache/retriever.go b/internal/source/gitlab/cache/retriever.go
index d6dd0924..01ce4a16 100644
--- a/internal/source/gitlab/cache/retriever.go
+++ b/internal/source/gitlab/cache/retriever.go
@@ -35,10 +35,13 @@ func NewRetriever(client api.Client, retrievalTimeout, maxRetrievalInterval time
// Retrieve retrieves a lookup response from external source with timeout and
// backoff. It has its own context with timeout.
-func (r *Retriever) Retrieve(ctx context.Context, domain string) (lookup api.Lookup) {
+func (r *Retriever) Retrieve(correlationID, domain string) (lookup api.Lookup) {
var logMsg string
- correlationID := correlation.ExtractFromContext(ctx)
+ ctx := correlation.ContextWithCorrelation(context.Background(), correlationID)
+
+ ctx, cancel := context.WithTimeout(ctx, r.retrievalTimeout)
+ defer cancel()
select {
case <-ctx.Done():