reorder startup steps (#1642)
so the Ctr+C hook and the metrics server go before the potentially slow `BeaconNode.init()`
This commit is contained in:
parent
ca2e7e2239
commit
60b8905852
|
@ -1145,8 +1145,6 @@ programMain:
|
|||
|
||||
config.createDumpDirs()
|
||||
|
||||
var node = waitFor BeaconNode.init(rng, config, stateSnapshotContents)
|
||||
|
||||
## Ctrl+C handling
|
||||
proc controlCHandler() {.noconv.} =
|
||||
when defined(windows):
|
||||
|
@ -1156,9 +1154,6 @@ programMain:
|
|||
status = BeaconNodeStatus.Stopping
|
||||
setControlCHook(controlCHandler)
|
||||
|
||||
when hasPrompt:
|
||||
initPrompt(node)
|
||||
|
||||
when useInsecureFeatures:
|
||||
if config.metricsEnabled:
|
||||
let metricsAddress = config.metricsAddress
|
||||
|
@ -1166,6 +1161,11 @@ programMain:
|
|||
address = metricsAddress, port = config.metricsPort
|
||||
metrics.startHttpServer($metricsAddress, config.metricsPort)
|
||||
|
||||
var node = waitFor BeaconNode.init(rng, config, stateSnapshotContents)
|
||||
|
||||
when hasPrompt:
|
||||
initPrompt(node)
|
||||
|
||||
if node.nickname != "":
|
||||
dynamicLogScope(node = node.nickname): node.start()
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue