mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-03 07:18:12 +08:00
Merge pull request #6419 from ipfs/fix/6418
pin: fix concurrent map access race
This commit is contained in:
parent
b0ea0b4d7d
commit
7c777eb83b
@ -498,11 +498,17 @@ func LoadPinner(d ds.Datastore, dserv, internal ipld.DAGService) (Pinner, error)
|
||||
|
||||
// DirectKeys returns a slice containing the directly pinned keys
|
||||
func (p *pinner) DirectKeys() []cid.Cid {
|
||||
p.lock.RLock()
|
||||
defer p.lock.RUnlock()
|
||||
|
||||
return p.directPin.Keys()
|
||||
}
|
||||
|
||||
// RecursiveKeys returns a slice containing the recursively pinned keys
|
||||
func (p *pinner) RecursiveKeys() []cid.Cid {
|
||||
p.lock.RLock()
|
||||
defer p.lock.RUnlock()
|
||||
|
||||
return p.recursePin.Keys()
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user