mirror of
https://github.com/ipfs/kubo.git
synced 2025-09-10 05:52:20 +08:00
Replace WithTimeout with WithCancel whenever possible
License: MIT Signed-off-by: rht <rhtbot@gmail.com>
This commit is contained in:
@ -1,8 +1,6 @@
|
||||
package ipns
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
|
||||
|
||||
"github.com/ipfs/go-ipfs/core"
|
||||
@ -22,7 +20,7 @@ func InitializeKeyspace(n *core.IpfsNode, key ci.PrivKey) error {
|
||||
return err
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithTimeout(n.Context(), time.Minute)
|
||||
ctx, cancel := context.WithCancel(n.Context())
|
||||
defer cancel()
|
||||
|
||||
err = n.Pinning.Pin(ctx, emptyDir, false)
|
||||
|
Reference in New Issue
Block a user