mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-21 10:27:46 +08:00
fix: cancel resolve search context
We probably don't need to do this, but it can't hurt.
This commit is contained in:
parent
00de344318
commit
5f19f3bbe8
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user