From 0fe437f4e4c26860189398efb7088ccb2574f83c Mon Sep 17 00:00:00 2001 From: Pedro Miranda Date: Fri, 17 Jan 2025 15:59:18 +0000 Subject: [PATCH] commented ctrl+c handler --- beacon_chain/nimbus_beacon_node.nim | 38 ++++++++++++++--------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/beacon_chain/nimbus_beacon_node.nim b/beacon_chain/nimbus_beacon_node.nim index 22de4a93d..b4fda0fa3 100644 --- a/beacon_chain/nimbus_beacon_node.nim +++ b/beacon_chain/nimbus_beacon_node.nim @@ -2398,26 +2398,26 @@ proc doRunBeaconNode*(config: var BeaconNodeConf, rng: ref HmacDrbgContext) {.ra for node in metadata.bootstrapNodes: config.bootstrapNodes.add node - ## Ctrl+C handling - proc controlCHandler() {.noconv.} = - when defined(windows): - # workaround for https://github.com/nim-lang/Nim/issues/4057 - try: - setupForeignThreadGc() - except Exception as exc: raiseAssert exc.msg # shouldn't happen - notice "Shutting down after having received SIGINT" - bnStatus = BeaconNodeStatus.Stopping - try: - setControlCHook(controlCHandler) - except Exception as exc: # TODO Exception - warn "Cannot set ctrl-c handler", msg = exc.msg + # ## Ctrl+C handling + # proc controlCHandler() {.noconv.} = + # when defined(windows): + # # workaround for https://github.com/nim-lang/Nim/issues/4057 + # try: + # setupForeignThreadGc() + # except Exception as exc: raiseAssert exc.msg # shouldn't happen + # notice "Shutting down after having received SIGINT" + # bnStatus = BeaconNodeStatus.Stopping + # try: + # setControlCHook(controlCHandler) + # except Exception as exc: # TODO Exception + # warn "Cannot set ctrl-c handler", msg = exc.msg - # equivalent SIGTERM handler - when defined(posix): - proc SIGTERMHandler(signal: cint) {.noconv.} = - notice "Shutting down after having received SIGTERM" - bnStatus = BeaconNodeStatus.Stopping - c_signal(ansi_c.SIGTERM, SIGTERMHandler) + # # equivalent SIGTERM handler + # when defined(posix): + # proc SIGTERMHandler(signal: cint) {.noconv.} = + # notice "Shutting down after having received SIGTERM" + # bnStatus = BeaconNodeStatus.Stopping + # c_signal(ansi_c.SIGTERM, SIGTERMHandler) block: let res =