Skip to content

Commit

Permalink
Repeat recurse/direct pin checks since they could have changed
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Michael Avila <[email protected]>
  • Loading branch information
michaelavila authored and Stebalien committed Sep 27, 2018
1 parent 254ac1b commit 7ed1a53
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pin/pin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 7ed1a53

Please sign in to comment.