DagstoreInitializeAll: handle zero concurrency case well.

This commit is contained in:
Raúl Kripalani 2021-08-05 14:56:52 +01:00
parent 21d078e7e1
commit 4974dc65d5

View File

@ -629,6 +629,11 @@ func (sm *StorageMinerAPI) DagstoreInitializeAll(ctx context.Context, params api
for i := 0; i < c; i++ { for i := 0; i < c; i++ {
throttle <- struct{}{} throttle <- struct{}{}
} }
} else {
// zero concurrency means no limit; a closed channel will always
// be receivable.
throttle = make(chan struct{})
close(throttle)
} }
info := sm.DAGStore.AllShardsInfo() info := sm.DAGStore.AllShardsInfo()