Skip to content

Commit d471370

Browse files
authored
Merge pull request ipfs/go-ipfs-pinner#2 from ipfs/fix/unlock-while-pinning
fix: don't hold the pin lock while updating pins This commit was moved from ipfs/go-ipfs-pinner@92e4fe9
2 parents 9dbbdbf + da00d16 commit d471370

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pinning/pinner/pin.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,11 @@ func (p *pinner) Update(ctx context.Context, from, to cid.Cid, unpin bool) error
526526
return fmt.Errorf("'from' cid was not recursively pinned already")
527527
}
528528

529+
// Temporarily unlock while we fetch the differences.
530+
p.lock.Unlock()
529531
err := dagutils.DiffEnumerate(ctx, p.dserv, from, to)
532+
p.lock.Lock()
533+
530534
if err != nil {
531535
return err
532536
}

0 commit comments

Comments
 (0)