Skip to content

Commit 0fe437f

Browse files
author
Pedro Miranda
committed
commented ctrl+c handler
1 parent 633c044 commit 0fe437f

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

beacon_chain/nimbus_beacon_node.nim

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2398,26 +2398,26 @@ proc doRunBeaconNode*(config: var BeaconNodeConf, rng: ref HmacDrbgContext) {.ra
23982398
for node in metadata.bootstrapNodes:
23992399
config.bootstrapNodes.add node
24002400

2401-
## Ctrl+C handling
2402-
proc controlCHandler() {.noconv.} =
2403-
when defined(windows):
2404-
# workaround for https://github.com/nim-lang/Nim/issues/4057
2405-
try:
2406-
setupForeignThreadGc()
2407-
except Exception as exc: raiseAssert exc.msg # shouldn't happen
2408-
notice "Shutting down after having received SIGINT"
2409-
bnStatus = BeaconNodeStatus.Stopping
2410-
try:
2411-
setControlCHook(controlCHandler)
2412-
except Exception as exc: # TODO Exception
2413-
warn "Cannot set ctrl-c handler", msg = exc.msg
2414-
2415-
# equivalent SIGTERM handler
2416-
when defined(posix):
2417-
proc SIGTERMHandler(signal: cint) {.noconv.} =
2418-
notice "Shutting down after having received SIGTERM"
2419-
bnStatus = BeaconNodeStatus.Stopping
2420-
c_signal(ansi_c.SIGTERM, SIGTERMHandler)
2401+
# ## Ctrl+C handling
2402+
# proc controlCHandler() {.noconv.} =
2403+
# when defined(windows):
2404+
# # workaround for https://github.com/nim-lang/Nim/issues/4057
2405+
# try:
2406+
# setupForeignThreadGc()
2407+
# except Exception as exc: raiseAssert exc.msg # shouldn't happen
2408+
# notice "Shutting down after having received SIGINT"
2409+
# bnStatus = BeaconNodeStatus.Stopping
2410+
# try:
2411+
# setControlCHook(controlCHandler)
2412+
# except Exception as exc: # TODO Exception
2413+
# warn "Cannot set ctrl-c handler", msg = exc.msg
2414+
2415+
# # equivalent SIGTERM handler
2416+
# when defined(posix):
2417+
# proc SIGTERMHandler(signal: cint) {.noconv.} =
2418+
# notice "Shutting down after having received SIGTERM"
2419+
# bnStatus = BeaconNodeStatus.Stopping
2420+
# c_signal(ansi_c.SIGTERM, SIGTERMHandler)
24212421

24222422
block:
24232423
let res =

0 commit comments

Comments
 (0)