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,12 +725,14 @@ func (sm *StorageMinerAPI) DagstoreInitializeAll(ctx context.Context, params api
go func() { go func() {
for i, k := range toInitialize { for i, k := range toInitialize {
if throttle != nil {
select { select {
case <-throttle: case <-throttle:
// acquired a throttle token, proceed. // acquired a throttle token, proceed.
case <-ctx.Done(): case <-ctx.Done():
return return
} }
}
go func(k string, i int) { go func(k string, i int) {
r := api.DagstoreInitializeAllEvent{ r := api.DagstoreInitializeAllEvent{