Hi,
I would like to add some clean-up code when service reload (run with --dev) or shutdown (with Crtl+C or something like kill). Is there any hook like beforeShutdown existing in the framework to gracefully shutdown the server?
If there is no such hook, I can use something like process.on('SIGTERM', clean_up_function); but I do not sure what I supposed to call to gracefully stop everything used by adonis
Hello!
Currently, there is no beforeShutdown hook, however, we do have plans to introduce it in v5
In v5, you can use providers shutdown method to execute actions when processing is shutting down gracefully.
Most helpful comment
Hello!
Currently, there is no
beforeShutdownhook, however, we do have plans to introduce it in v5