namesys: set the correct cache TTL on publish

fixes https://github.com/ipfs/go-ipfs/issues/6656#issuecomment-534252128
This commit is contained in:
Steven Allen 2019-09-23 14:05:37 -07:00
parent 721c1abe4c
commit 36c0cbf4e1

View File

@ -183,6 +183,9 @@ func (ns *mpns) PublishWithEOL(ctx context.Context, name ci.PrivKey, value path.
return err
}
ttl := DefaultResolverCacheTTL
if setTTL, ok := checkCtxTTL(ctx); ok {
ttl = setTTL
}
if ttEol := time.Until(eol); ttEol < ttl {
ttl = ttEol
}