Skip to content

Commit

Permalink
fix pin-lock in dag put
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
  • Loading branch information
Stebalien committed Oct 27, 2018
1 parent b8d7d25 commit ce7d021
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/commands/dag/dag.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ into an object of the specified format.
cids := cid.NewSet()
b := ipld.NewBatch(req.Context, nd.DAG)

if dopin {
defer nd.Blockstore.PinLock().Unlock()
}

for {
file, err := req.Files.NextFile()
if err == io.EOF {
Expand Down Expand Up @@ -125,8 +129,6 @@ into an object of the specified format.
}

if dopin {
defer nd.Blockstore.PinLock().Unlock()

cids.ForEach(func(c cid.Cid) error {
nd.Pinning.PinWithMode(c, pin.Recursive)
return nil
Expand Down

0 comments on commit ce7d021

Please sign in to comment.