Skip to content

Commit

Permalink
Merge pull request #7276 from ipfs/patch-0.5.1/7244
Browse files Browse the repository at this point in the history
IPNS timeout patch from master
  • Loading branch information
aschmahmann committed May 5, 2020
2 parents 3da81e1 + b1e0f78 commit ae53665
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions namesys/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (

const ipnsPrefix = "/ipns/"

const PublishPutValTimeout = time.Minute
const DefaultRecordEOL = 24 * time.Hour

// IpnsPublisher is capable of publishing and resolving names to the IPFS
Expand Down Expand Up @@ -269,23 +268,18 @@ func PublishPublicKey(ctx context.Context, r routing.ValueStore, k string, pubk
}

// Store associated public key
timectx, cancel := context.WithTimeout(ctx, PublishPutValTimeout)
defer cancel()
return r.PutValue(timectx, k, pkbytes)
return r.PutValue(ctx, k, pkbytes)
}

func PublishEntry(ctx context.Context, r routing.ValueStore, ipnskey string, rec *pb.IpnsEntry) error {
timectx, cancel := context.WithTimeout(ctx, PublishPutValTimeout)
defer cancel()

data, err := proto.Marshal(rec)
if err != nil {
return err
}

log.Debugf("Storing ipns entry at: %s", ipnskey)
// Store ipns entry at "/ipns/"+h(pubkey)
return r.PutValue(timectx, ipnskey, data)
return r.PutValue(ctx, ipnskey, data)
}

// InitializeKeyspace sets the ipns record for the given key to
Expand Down

0 comments on commit ae53665

Please sign in to comment.