Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

Commit

Permalink
Merge pull request #2 from ipfs/fix/unlock-while-pinning
Browse files Browse the repository at this point in the history
fix: don't hold the pin lock while updating pins
  • Loading branch information
Stebalien authored Feb 17, 2020
2 parents 495dd3c + f08a8a1 commit 92e4fe9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pin.go
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,11 @@ func (p *pinner) Update(ctx context.Context, from, to cid.Cid, unpin bool) error
return fmt.Errorf("'from' cid was not recursively pinned already")
}

// Temporarily unlock while we fetch the differences.
p.lock.Unlock()
err := dagutils.DiffEnumerate(ctx, p.dserv, from, to)
p.lock.Lock()

if err != nil {
return err
}
Expand Down

0 comments on commit 92e4fe9

Please sign in to comment.