Skip to content

Commit

Permalink
chore: initialise metric server after script in main
Browse files Browse the repository at this point in the history
  • Loading branch information
jrwbabylonlab committed Dec 10, 2024
1 parent 040e3b5 commit 35ab2bf
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cmd/staking-api-service/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ func main() {
log.Fatal().Err(err).Msg(fmt.Sprintf("error while loading finality providers file: %s", finalityProvidersPath))
}

// initialize metrics with the metrics port from config
metricsPort := cfg.Metrics.GetMetricsPort()
metrics.Init(metricsPort)

err = dbmodel.Setup(ctx, cfg)
if err != nil {
log.Fatal().Err(err).Msg("error while setting up staking db model")
Expand Down Expand Up @@ -103,6 +99,11 @@ func main() {
return
}

// initialize metrics with the metrics port from config
metricsPort := cfg.Metrics.GetMetricsPort()
metrics.Init(metricsPort)

// Start the event queue processing
v2queues.StartReceivingMessages()

healthcheckErr := healthcheck.StartHealthCheckCron(ctx, v2queues, cfg.Server.HealthCheckInterval)
Expand Down

0 comments on commit 35ab2bf

Please sign in to comment.