mirror of
https://github.com/ipfs/kubo.git
synced 2025-09-10 05:52:20 +08:00
Fix 'ctx, _' to have explicit cancel
License: MIT Signed-off-by: rht <rhtbot@gmail.com>
This commit is contained in:
@ -60,7 +60,8 @@ func (p *ipnsPublisher) Publish(ctx context.Context, k ci.PrivKey, value path.Pa
|
||||
|
||||
log.Debugf("Storing pubkey at: %s", namekey)
|
||||
// Store associated public key
|
||||
timectx, _ := context.WithDeadline(ctx, time.Now().Add(time.Second*10))
|
||||
timectx, cancel := context.WithDeadline(ctx, time.Now().Add(time.Second*10))
|
||||
defer cancel()
|
||||
err = p.routing.PutValue(timectx, namekey, pkbytes)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -70,9 +71,9 @@ func (p *ipnsPublisher) Publish(ctx context.Context, k ci.PrivKey, value path.Pa
|
||||
|
||||
log.Debugf("Storing ipns entry at: %s", ipnskey)
|
||||
// Store ipns entry at "/ipns/"+b58(h(pubkey))
|
||||
timectx, _ = context.WithDeadline(ctx, time.Now().Add(time.Second*10))
|
||||
err = p.routing.PutValue(timectx, ipnskey, data)
|
||||
if err != nil {
|
||||
timectx, cancel = context.WithDeadline(ctx, time.Now().Add(time.Second*10))
|
||||
defer cancel()
|
||||
if err := p.routing.PutValue(timectx, ipnskey, data); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user