1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-20 19:19:06 +08:00

Repeat recurse/direct pin checks since they could have changed

License: MIT
Signed-off-by: Michael Avila <me@michaelavila.com>
This commit is contained in:
Michael Avila
2018-09-23 09:29:00 -07:00
committed by Steven Allen
parent 254ac1b118
commit 7ed1a5361f

View File

@ -236,6 +236,14 @@ func (p *pinner) Pin(ctx context.Context, node ipld.Node, recurse bool) error {
return err
}
if p.recursePin.Has(c) {
return nil
}
if p.directPin.Has(c) {
p.directPin.Remove(c)
}
p.recursePin.Add(c)
} else {
p.lock.Unlock()