From a60da5be9940410321f3de6d0d06b18c03116285 Mon Sep 17 00:00:00 2001 From: vyzo Date: Thu, 23 Mar 2023 17:28:08 +0200 Subject: [PATCH] only call Atoi on non empty strings --- chain/vm/execution.go | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/chain/vm/execution.go b/chain/vm/execution.go index e55883dae..8db0e4313 100644 --- a/chain/vm/execution.go +++ b/chain/vm/execution.go @@ -146,19 +146,21 @@ func init() { concurrency := os.Getenv("LOTUS_FVM_CONCURRENCY") if concurrency == "" { available = DefaultAvailableExecutionLanes - } - available, err = strconv.Atoi(concurrency) - if err != nil { - panic(err) + } else { + available, err = strconv.Atoi(concurrency) + if err != nil { + panic(err) + } } reserved := os.Getenv("LOTUS_FVM_CONCURRENCY_RESERVED") if reserved == "" { priority = DefaultPriorityExecutionLanes - } - priority, err = strconv.Atoi(reserved) - if err != nil { - panic(err) + } else { + priority, err = strconv.Atoi(reserved) + if err != nil { + panic(err) + } } mx := &sync.Mutex{}