How can I let my program keep running even if it receives SIGINT?
I succeeded to write a program to handle but Deno always exits when it receives a [Edit: It was my mistake. Deno keeps running if a signal handler was registered.] I just want my program to reload the configuration file instead of terminating when it receives
SIGINT
using Deno.addSignalListener("SIGINT", ...)
API, SIGINT
whether I put Deno.exit()
inside the signal handler or not.SIGINT
. Is there any way to do it?4 Replies
You can stop a program from existing by using
beforeunload
listener: https://deno.land/manual@v1.29.4/runtime/program_lifecycle#program-lifecycleIf you call
preventDefault()
on the event it will, well, prevent the default handling from occurring which is to close the program.Sorry, it was my mistake. I tested again with a minimal example, and Deno apparently keeps running even if it receives
SIGINT
once after I registered a signal handler.Ah, okay.