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 call process.exit(), which will in turn ensure that all sub-processes are exited too.
    • on a uncaughtRejection or uncaughtRejection, try to gracefully shut down the server with process.stop().
      • Wait process.env.ACTIONHERO_SHUTDOWN_TIMEOUT (or 30 seconds) and then process.exit()
    • only catch one uncaughtRejection or uncaughtRejection

    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();