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 <[email protected]>
  • Loading branch information
Stebalien committed Oct 26, 2018
1 parent 617c54c commit 7ed86f8
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 @@ -88,6 +88,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 @@ -124,8 +128,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 7ed86f8

Please sign in to comment.