Skip to content

Commit 7ed86f8

Browse files
committed
fix pin-lock in dag put
License: MIT Signed-off-by: Steven Allen <[email protected]>
1 parent 617c54c commit 7ed86f8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

core/commands/dag/dag.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ into an object of the specified format.
8888
cids := cid.NewSet()
8989
b := ipld.NewBatch(req.Context, nd.DAG)
9090

91+
if dopin {
92+
defer nd.Blockstore.PinLock().Unlock()
93+
}
94+
9195
for {
9296
file, err := req.Files.NextFile()
9397
if err == io.EOF {
@@ -124,8 +128,6 @@ into an object of the specified format.
124128
}
125129

126130
if dopin {
127-
defer nd.Blockstore.PinLock().Unlock()
128-
129131
cids.ForEach(func(c cid.Cid) error {
130132
nd.Pinning.PinWithMode(c, pin.Recursive)
131133
return nil

0 commit comments

Comments
 (0)