Skip to content

Commit e4ab28b

Browse files
committed
Prevent grunt from exiting without letting express stop
1 parent f8cdaf0 commit e4ab28b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Gruntfile.js

+10
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,16 @@ const configureGrunt = function (grunt) {
4848
grunt.loadNpmTasks('grunt-subgrunt');
4949
grunt.loadNpmTasks('grunt-update-submodules');
5050

51+
/** This little bit of weirdness gives the express server chance to shutdown properly */
52+
const waitBeforeExit = () => {
53+
setTimeout(() => {
54+
process.exit(0);
55+
}, 1000);
56+
};
57+
58+
process.on('SIGINT', waitBeforeExit);
59+
process.on('SIGTERM', waitBeforeExit);
60+
5161
const cfg = {
5262
// #### Common paths used by tasks
5363
paths: {

0 commit comments

Comments
 (0)