提交 a0c0355d 作者: Steven Allen

fix pin-lock in dag put

License: MIT
Signed-off-by: 's avatarSteven Allen <steven@stebalien.com>
上级 b8d7d255
...@@ -13,7 +13,6 @@ import ( ...@@ -13,7 +13,6 @@ import (
mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash"
path "gx/ipfs/QmRKuTyCzg7HFBcV1YUhzStroGtJSb8iWgyxfsDCwFhWTS/go-path" path "gx/ipfs/QmRKuTyCzg7HFBcV1YUhzStroGtJSb8iWgyxfsDCwFhWTS/go-path"
cmds "gx/ipfs/QmSXUokcP4TJpFfqozT69AVAYRtzXVMUjzQVkYX41R9Svs/go-ipfs-cmds" cmds "gx/ipfs/QmSXUokcP4TJpFfqozT69AVAYRtzXVMUjzQVkYX41R9Svs/go-ipfs-cmds"
files "gx/ipfs/QmZMWMvWMVKCbHetJ4RgndbuEF1io2UpUxwQwtNjtYPzSC/go-ipfs-files"
ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format"
cmdkit "gx/ipfs/Qmde5VP1qUkyQXKCfmEUA7bP64V2HAptbJ7phuPp7jXWwg/go-ipfs-cmdkit" cmdkit "gx/ipfs/Qmde5VP1qUkyQXKCfmEUA7bP64V2HAptbJ7phuPp7jXWwg/go-ipfs-cmdkit"
) )
...@@ -89,6 +88,10 @@ into an object of the specified format. ...@@ -89,6 +88,10 @@ into an object of the specified format.
cids := cid.NewSet() cids := cid.NewSet()
b := ipld.NewBatch(req.Context, nd.DAG) b := ipld.NewBatch(req.Context, nd.DAG)
if dopin {
defer nd.Blockstore.PinLock().Unlock()
}
for { for {
file, err := req.Files.NextFile() file, err := req.Files.NextFile()
if err == io.EOF { if err == io.EOF {
...@@ -125,8 +128,6 @@ into an object of the specified format. ...@@ -125,8 +128,6 @@ into an object of the specified format.
} }
if dopin { if dopin {
defer nd.Blockstore.PinLock().Unlock()
cids.ForEach(func(c cid.Cid) error { cids.ForEach(func(c cid.Cid) error {
nd.Pinning.PinWithMode(c, pin.Recursive) nd.Pinning.PinWithMode(c, pin.Recursive)
return nil return nil
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论