ActionHero v22.0.5 Release Notes
Release Date: 2020-03-12 // about 4 years ago-
👍 Better Server Shutdown (#1424)
- 🚦 provide a callback to
app.registerProcessSignals
which will be called when the app is fully shut down. This provides an explicit place to callprocess.exit()
, which will in turn ensure that all sub-processes are exited too. - on a
uncaughtRejection
oruncaughtRejection
, try to gracefully shut down the server withprocess.stop()
.- Wait
process.env.ACTIONHERO_SHUTDOWN_TIMEOUT
(or 30 seconds) and thenprocess.exit()
- Wait
- only catch one
uncaughtRejection
oruncaughtRejection
The recommended
server.ts
is now:import { Process } from "./index";// load any custom code, configure the env, as neededasync function main() { // create a new actionhero processconst app = new Process(); // handle unix signals and uncaught exceptions & rejectionsapp.registerProcessSignals(exitCode =\> { process.exit(exitCode); }); // start the app!// you can pass custom configuration to the process as neededawait app.start(); }main();
- 🚦 provide a callback to