@cryptotaxi247 / kubo / commits / 52344abd3

fix: do not use hard coded IPNS Publish maximum timeout duration

Adin Schmahmann committed Apr 29, 2020 at 17:57 UTC 52344abd313d6715caf73c0045709f0d0a3f1e49
1 file changed +2 -8
namesys/publisher.go
+2 -8
@@ -22,7 +22,6 @@ import (
22
23 const ipnsPrefix = "/ipns/"
24
25 -const PublishPutValTimeout = time.Minute
25 const DefaultRecordEOL = 24 * time.Hour
26
27 // IpnsPublisher is capable of publishing and resolving names to the IPFS
@@ -269,15 +268,10 @@ func PublishPublicKey(ctx context.Context, r routing.ValueStore, k string, pubk
268 }
269
270 // Store associated public key
272 - timectx, cancel := context.WithTimeout(ctx, PublishPutValTimeout)
273 - defer cancel()
274 - return r.PutValue(timectx, k, pkbytes)
271 + return r.PutValue(ctx, k, pkbytes)
272 }
273
274 func PublishEntry(ctx context.Context, r routing.ValueStore, ipnskey string, rec *pb.IpnsEntry) error {
278 - timectx, cancel := context.WithTimeout(ctx, PublishPutValTimeout)
279 - defer cancel()
280 -
275 data, err := proto.Marshal(rec)
276 if err != nil {
277 return err
@@ -285,7 +279,7 @@ func PublishEntry(ctx context.Context, r routing.ValueStore, ipnskey string, rec
279
280 log.Debugf("Storing ipns entry at: %s", ipnskey)
281 // Store ipns entry at "/ipns/"+h(pubkey)
288 - return r.PutValue(timectx, ipnskey, data)
282 + return r.PutValue(ctx, ipnskey, data)
283 }
284
285 // InitializeKeyspace sets the ipns record for the given key to