only call Atoi on non empty strings

This commit is contained in:
vyzo 2023-03-23 17:28:08 +02:00
parent 7362556c02
commit ee6c0f8570

View File

@ -146,19 +146,21 @@ func init() {
concurrency := os.Getenv("LOTUS_FVM_CONCURRENCY") concurrency := os.Getenv("LOTUS_FVM_CONCURRENCY")
if concurrency == "" { if concurrency == "" {
available = DefaultAvailableExecutionLanes available = DefaultAvailableExecutionLanes
} } else {
available, err = strconv.Atoi(concurrency) available, err = strconv.Atoi(concurrency)
if err != nil { if err != nil {
panic(err) panic(err)
}
} }
reserved := os.Getenv("LOTUS_FVM_CONCURRENCY_RESERVED") reserved := os.Getenv("LOTUS_FVM_CONCURRENCY_RESERVED")
if reserved == "" { if reserved == "" {
priority = DefaultPriorityExecutionLanes priority = DefaultPriorityExecutionLanes
} } else {
priority, err = strconv.Atoi(reserved) priority, err = strconv.Atoi(reserved)
if err != nil { if err != nil {
panic(err) panic(err)
}
} }
mx := &sync.Mutex{} mx := &sync.Mutex{}