Unverified 提交 d8ed9aba 作者: Steven Allen 提交者: GitHub

Merge pull request #5550 from ipfs/fix/coreapi-pin-lock

take the pinlock when updating pins
......@@ -22,13 +22,13 @@ func (api *PinAPI) Add(ctx context.Context, p coreiface.Path, opts ...caopts.Pin
return err
}
defer api.node.Blockstore.PinLock().Unlock()
rp, err := api.core().ResolvePath(ctx, p)
if err != nil {
return err
}
defer api.node.Blockstore.PinLock().Unlock()
_, err = corerepo.Pin(api.node, api.core(), ctx, []string{rp.Cid().String()}, settings.Recursive)
if err != nil {
return err
......@@ -77,6 +77,8 @@ func (api *PinAPI) Update(ctx context.Context, from coreiface.Path, to coreiface
return err
}
defer api.node.Blockstore.PinLock().Unlock()
err = api.node.Pinning.Update(ctx, fp.Cid(), tp.Cid(), settings.Unpin)
if err != nil {
return err
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论