1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-07-01 10:49:24 +08:00

namesys: extract DefaultRecortTTL to a variable

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
This commit is contained in:
Jakub Sztandera
2016-12-14 20:50:04 +01:00
parent b558012d27
commit 2d37e60334
2 changed files with 3 additions and 2 deletions

View File

@ -93,7 +93,7 @@ func (ns *mpns) Publish(ctx context.Context, name ci.PrivKey, value path.Path) e
if err != nil {
return err
}
ns.addToDHTCache(name, value, time.Now().Add(time.Hour*24))
ns.addToDHTCache(name, value, time.Now().Add(DefaultRecortTTL))
return nil
}

View File

@ -33,6 +33,7 @@ var ErrExpiredRecord = errors.New("expired record")
var ErrUnrecognizedValidity = errors.New("unrecognized validity type")
var PublishPutValTimeout = time.Minute
var DefaultRecortTTL = 24 * time.Hour
// ipnsPublisher is capable of publishing and resolving names to the IPFS
// routing system.
@ -53,7 +54,7 @@ func NewRoutingPublisher(route routing.ValueStore, ds ds.Datastore) *ipnsPublish
// and publishes it out to the routing system
func (p *ipnsPublisher) Publish(ctx context.Context, k ci.PrivKey, value path.Path) error {
log.Debugf("Publish %s", value)
return p.PublishWithEOL(ctx, k, value, time.Now().Add(time.Hour*24))
return p.PublishWithEOL(ctx, k, value, time.Now().Add(DefaultRecortTTL))
}
// PublishWithEOL is a temporary stand in for the ipns records implementation