Skip to content

Commit

Permalink
db_size metric is calculation only when metric.Enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
uprendis committed Oct 14, 2023
1 parent 20c3d1d commit 406dc20
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/opera/launcher/launcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/ethereum/go-ethereum/console/prompt"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/log"
gmetrics "github.com/ethereum/go-ethereum/metrics"
"github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/p2p/discover/discfilter"
"github.com/ethereum/go-ethereum/params"
Expand Down Expand Up @@ -299,7 +300,10 @@ func makeNode(ctx *cli.Context, cfg *config, genesisStore *genesisstore.Store) (
if genesisStore != nil {
_ = genesisStore.Close()
}
metrics.SetDataDir(cfg.Node.DataDir)

if gmetrics.Enabled {
metrics.SetDataDir(cfg.Node.DataDir)
}
memorizeDBPreset(cfg)

// substitute default bootnodes if requested
Expand Down

0 comments on commit 406dc20

Please sign in to comment.