Skip to content
This repository was archived by the owner on Dec 10, 2020. It is now read-only.

Commit 8c1cfcc

Browse files
committed
Add force shutdown
1 parent 238b499 commit 8c1cfcc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

bin/cli.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,12 @@ async function run() {
156156
const node = await runNode(options)
157157
const server = args.rpc ? runRpcServer(node, options) : null
158158

159-
process.on('SIGINT', async () => {
159+
process.once('SIGINT', async () => {
160+
process.once('SIGINT', () => {
161+
logger.info('Force shutdown. Exit immediately.')
162+
process.exit(1)
163+
})
164+
160165
logger.info('Caught interrupt signal. Shutting down...')
161166
if (server) server.http().close()
162167
await node.stop()

0 commit comments

Comments
 (0)