ignore nil throttler

This commit is contained in:
Aarsh Shah 2021-08-24 10:42:00 +05:30
parent 01ea39adad
commit e1a056db46

View File

@ -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) {