ignore nil throttler
This commit is contained in:
parent
01ea39adad
commit
e1a056db46
@ -725,11 +725,13 @@ func (sm *StorageMinerAPI) DagstoreInitializeAll(ctx context.Context, params api
|
|||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
for i, k := range toInitialize {
|
for i, k := range toInitialize {
|
||||||
select {
|
if throttle != nil {
|
||||||
case <-throttle:
|
select {
|
||||||
// acquired a throttle token, proceed.
|
case <-throttle:
|
||||||
case <-ctx.Done():
|
// acquired a throttle token, proceed.
|
||||||
return
|
case <-ctx.Done():
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
go func(k string, i int) {
|
go func(k string, i int) {
|
||||||
|
Loading…
Reference in New Issue
Block a user