diff --git a/Gruntfile.js b/Gruntfile.js index bb6f99a18a..bd75a0383a 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -48,6 +48,16 @@ const configureGrunt = function (grunt) { grunt.loadNpmTasks('grunt-subgrunt'); grunt.loadNpmTasks('grunt-update-submodules'); + /** This little bit of weirdness gives the express server chance to shutdown properly */ + const waitBeforeExit = () => { + setTimeout(() => { + process.exit(0); + }, 1000); + }; + + process.on('SIGINT', waitBeforeExit); + process.on('SIGTERM', waitBeforeExit); + const cfg = { // #### Common paths used by tasks paths: {