mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-02 23:08:07 +08:00
Merge pull request #6444 from dirkmc/fix/pin-rm-add-lock
Fix: ensure pin rm takes a lock
This commit is contained in:
parent
98e7a3d981
commit
b0ea0b4d7d
@ -67,6 +67,10 @@ func (api *PinAPI) Rm(ctx context.Context, p path.Path, opts ...caopts.PinRmOpti
|
||||
return err
|
||||
}
|
||||
|
||||
// Note: after unpin the pin sets are flushed to the blockstore, so we need
|
||||
// to take a lock to prevent a concurrent garbage collection
|
||||
defer api.blockstore.PinLock().Unlock()
|
||||
|
||||
if err = api.pinning.Unpin(ctx, rp.Cid(), settings.Recursive); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user