fix: cancel resolve search context
We probably don't need to do this, but it can't hurt.
Steven Allen committed
Jun 17, 2020 at 19:43 UTC
5f19f3bbe86cf709d503720ebacf86f4c9faf63c
1 file changed
+3
core/coreapi/name.go
+3
@@ -120,6 +120,9 @@ func (api *NameAPI) Search(ctx context.Context, name string, opts ...caopts.Name
120
// Resolve attempts to resolve the newest version of the specified name and
121
// returns its path.
122
func (api *NameAPI) Resolve(ctx context.Context, name string, opts ...caopts.NameResolveOption) (path.Path, error) {
123
+ ctx, cancel := context.WithCancel(ctx)
124
+ defer cancel()
125
+
126
results, err := api.Search(ctx, name, opts...)
127
if err != nil {
128
return nil, err