From e1a056db4631fdae3f2ce5e70302772045c14aee Mon Sep 17 00:00:00 2001 From: Aarsh Shah Date: Tue, 24 Aug 2021 10:42:00 +0530 Subject: [PATCH] ignore nil throttler --- node/impl/storminer.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/node/impl/storminer.go b/node/impl/storminer.go index 657e8cfdf..ff016259a 100644 --- a/node/impl/storminer.go +++ b/node/impl/storminer.go @@ -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) {