Quit from Adonis application

hi,
is it possible to quit from an Adonis application? In my system sometimes I have to close the app (in order to automatically upgrade) and the only solution I could find is to kill the process. It does not look like something too elegant, is there a better way?

thank you
Davide

Hi @davidemania

I belive process.exit() is closest you can get out of the box.
https://nodejs.org/api/process.html#process_process_exit_code

You could make your custom ace command to shut down more gracefully but I doupt there will be need for that.

On the other hand if process.exit() is too graceful you can use process.abort()
https://nodejs.org/api/process.html#process_process_abort

Edit:
Also there is nothing too wrong in sigterm (regular kill) sigterm vs sigkill

1 Like