Merge pull request #7169 from filecoin-project/feat/dagstore-zero-concurrency
Ignore nil throttler
This commit is contained in:
commit
5993257eb1
@ -725,11 +725,13 @@ func (sm *StorageMinerAPI) DagstoreInitializeAll(ctx context.Context, params api
|
||||
|
||||
go func() {
|
||||
for i, k := range toInitialize {
|
||||
select {
|
||||
case <-throttle:
|
||||
// acquired a throttle token, proceed.
|
||||
case <-ctx.Done():
|
||||
return
|
||||
if throttle != nil {
|
||||
select {
|
||||
case <-throttle:
|
||||
// acquired a throttle token, proceed.
|
||||
case <-ctx.Done():
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
go func(k string, i int) {
|
||||
|
Loading…
Reference in New Issue
Block a user