Fixes #996 pin expiry is updated if set in options

This commit is contained in:
deepakgarg 2020-03-26 20:07:23 -07:00
parent e3e14bd15f
commit 788ecff327

View File

@ -1496,7 +1496,9 @@ func (c *Cluster) PinUpdate(ctx context.Context, from cid.Cid, to cid.Cid, opts
if opts.Name != "" {
existing.Name = opts.Name
}
if !opts.ExpireAt.IsZero() && opts.ExpireAt.After(time.Now()) {
existing.ExpireAt = opts.ExpireAt
}
return existing, c.consensus.LogPin(ctx, existing)
}