Prevent grunt from exiting without letting express stop

This commit is contained in:
Hannah Wolfe 2020-08-07 19:19:25 +01:00
parent f8cdaf0c24
commit e4ab28b70f

View File

@ -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: {