Fix PinLsCid and pins with maxdepth 0 after migration
License: MIT Signed-off-by: Hector Sanjuan <code@hector.link>
This commit is contained in:
parent
63fa1ba213
commit
6c28d6bf3e
|
@ -656,10 +656,9 @@ func (ipfs *Connector) PinLsCid(ctx context.Context, hash *cid.Cid) (api.IPFSPin
|
|||
return api.IPFSPinStatusError, err
|
||||
}
|
||||
|
||||
// Pin not found. Try next type
|
||||
if err != nil {
|
||||
continue
|
||||
|
||||
// Pin found. Do not keep looking.
|
||||
if err == nil {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -151,11 +151,12 @@ func (st *mapStateV4) next() migrateable {
|
|||
pinsv5.Cid = v.Cid
|
||||
pinsv5.Type = uint64(api.DataType)
|
||||
pinsv5.Allocations = v.Allocations
|
||||
if v.Recursive {
|
||||
pinsv5.MaxDepth = -1
|
||||
} else {
|
||||
pinsv5.MaxDepth = 0
|
||||
}
|
||||
|
||||
// Encountered pins with Recursive=false
|
||||
// in previous states. Since we do not support
|
||||
// non recursive pins yet, we fix it by
|
||||
// harcoding MaxDepth.
|
||||
pinsv5.MaxDepth = -1
|
||||
|
||||
// Options
|
||||
pinsv5.Name = v.Name
|
||||
|
|
Loading…
Reference in New Issue
Block a user