From c48860c70ff931a71fd20d7c3e4d6355a6322cd4 Mon Sep 17 00:00:00 2001 From: Haoliang Gao Date: Tue, 27 Mar 2018 12:45:08 +0800 Subject: [PATCH] feat: set EGG_MASTER_CLOSE_TIMEOUT when run dev (#88) --- lib/cmd/dev.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/cmd/dev.js b/lib/cmd/dev.js index 1292475a..a187ee26 100644 --- a/lib/cmd/dev.js +++ b/lib/cmd/dev.js @@ -42,9 +42,13 @@ class DevCommand extends Command { * run(context) { const devArgs = yield this.formatArgs(context); + const env = { + NODE_ENV: 'development', + EGG_MASTER_CLOSE_TIMEOUT: 1000, + }; const options = { execArgv: context.execArgv, - env: Object.assign({ NODE_ENV: 'development' }, context.env), + env: Object.assign(env, context.env), }; debug('%s %j %j, %j', this.serverBin, devArgs, options.execArgv, options.env.NODE_ENV); yield this.helper.forkNode(this.serverBin, devArgs, options);