From 5f19f3bbe86cf709d503720ebacf86f4c9faf63c Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Wed, 17 Jun 2020 19:43:20 -0700 Subject: [PATCH] fix: cancel resolve search context We probably don't need to do this, but it can't hurt. --- core/coreapi/name.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/coreapi/name.go b/core/coreapi/name.go index 4792196b6..ec653a394 100644 --- a/core/coreapi/name.go +++ b/core/coreapi/name.go @@ -120,6 +120,9 @@ func (api *NameAPI) Search(ctx context.Context, name string, opts ...caopts.Name // Resolve attempts to resolve the newest version of the specified name and // returns its path. func (api *NameAPI) Resolve(ctx context.Context, name string, opts ...caopts.NameResolveOption) (path.Path, error) { + ctx, cancel := context.WithCancel(ctx) + defer cancel() + results, err := api.Search(ctx, name, opts...) if err != nil { return nil, err