From 0fdc47e84265f95d853d64a949f3ed774bc2c3d9 Mon Sep 17 00:00:00 2001 From: Koong Kyungmi Date: Mon, 4 Jan 2016 21:35:29 +0900 Subject: [PATCH] [BUGFIX] No stdout with `git config --get-regexp user` command. [DESC.] - change listening event(checking process finished) from `'exit'` to ``'close'` because the `'close'` event wait until stream closes --- src/server/fs/lib/console-manager.js | 2 +- src/server/fs/lib/container/Container.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/fs/lib/console-manager.js b/src/server/fs/lib/console-manager.js index a9f0bfa..0807bf3 100644 --- a/src/server/fs/lib/console-manager.js +++ b/src/server/fs/lib/console-manager.js @@ -82,7 +82,7 @@ function _startProc(cexec, callback) { proc._stderr += data; }); - proc.on('exit', function (code) { + proc.on('close', function (code) { logger.debug('Exec close', proc.pid, 'code:' + code, 'stdout:' + proc._stdout, 'stderr:' + proc._stderr); _removeProc(cexec); if (code !== 0) { diff --git a/src/server/fs/lib/container/Container.js b/src/server/fs/lib/container/Container.js index e734748..ea6dffb 100644 --- a/src/server/fs/lib/container/Container.js +++ b/src/server/fs/lib/container/Container.js @@ -138,8 +138,8 @@ Container.prototype.afterExecute_ = function (callback) { }); }, this.options.timeout); } - this.proc.on('exit', function () { - logger.debug('Container exit:', arguments); + this.proc.on('close', function () { + logger.debug('Container close:', arguments); self.onTerminated_(); }); this.proc.on('error', function (err) {