Skip to content

Commit

Permalink
reorg initialization code for better readability, remove unused import
Browse files Browse the repository at this point in the history
  • Loading branch information
vyzo committed Mar 30, 2023
1 parent 7b4e682 commit d71b528
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions chain/vm/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package vm

import (
"context"
"errors"
"os"
"strconv"
"sync"
Expand Down Expand Up @@ -154,23 +153,18 @@ func metricsAdjust(metric *stats.Int64Measure, lane ExecutionLane, delta int) {
}

func init() {
var available, priority int
var err error

concurrency := os.Getenv("LOTUS_FVM_CONCURRENCY")
if concurrency == "" {
available = DefaultAvailableExecutionLanes
} else {
available := DefaultAvailableExecutionLanes
if concurrency := os.Getenv("LOTUS_FVM_CONCURRENCY"); concurrency != "" {
available, err = strconv.Atoi(concurrency)
if err != nil {
panic(err)
}
}

reserved := os.Getenv("LOTUS_FVM_CONCURRENCY_RESERVED")
if reserved == "" {
priority = DefaultPriorityExecutionLanes
} else {
priority := DefaultPriorityExecutionLanes
if reserved := os.Getenv("LOTUS_FVM_CONCURRENCY_RESERVED"); reserved != "" {
priority, err = strconv.Atoi(reserved)
if err != nil {
panic(err)
Expand Down

0 comments on commit d71b528

Please sign in to comment.