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()
|
config.createDumpDirs()
|
||||||
|
|
||||||
var node = waitFor BeaconNode.init(rng, config, stateSnapshotContents)
|
|
||||||
|
|
||||||
## Ctrl+C handling
|
## Ctrl+C handling
|
||||||
proc controlCHandler() {.noconv.} =
|
proc controlCHandler() {.noconv.} =
|
||||||
when defined(windows):
|
when defined(windows):
|
||||||
|
@ -1156,9 +1154,6 @@ programMain:
|
||||||
status = BeaconNodeStatus.Stopping
|
status = BeaconNodeStatus.Stopping
|
||||||
setControlCHook(controlCHandler)
|
setControlCHook(controlCHandler)
|
||||||
|
|
||||||
when hasPrompt:
|
|
||||||
initPrompt(node)
|
|
||||||
|
|
||||||
when useInsecureFeatures:
|
when useInsecureFeatures:
|
||||||
if config.metricsEnabled:
|
if config.metricsEnabled:
|
||||||
let metricsAddress = config.metricsAddress
|
let metricsAddress = config.metricsAddress
|
||||||
|
@ -1166,6 +1161,11 @@ programMain:
|
||||||
address = metricsAddress, port = config.metricsPort
|
address = metricsAddress, port = config.metricsPort
|
||||||
metrics.startHttpServer($metricsAddress, config.metricsPort)
|
metrics.startHttpServer($metricsAddress, config.metricsPort)
|
||||||
|
|
||||||
|
var node = waitFor BeaconNode.init(rng, config, stateSnapshotContents)
|
||||||
|
|
||||||
|
when hasPrompt:
|
||||||
|
initPrompt(node)
|
||||||
|
|
||||||
if node.nickname != "":
|
if node.nickname != "":
|
||||||
dynamicLogScope(node = node.nickname): node.start()
|
dynamicLogScope(node = node.nickname): node.start()
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue