From d947a8bac9997721643199a421602d81ebd55e8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jarno=20Le=20Conte=CC=81?= Date: Thu, 19 May 2016 17:19:46 +0200 Subject: [PATCH] Solve high cpu usage on osx. --- lib/app.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/lib/app.js b/lib/app.js index cfa95ce..00ed7f0 100644 --- a/lib/app.js +++ b/lib/app.js @@ -61,16 +61,14 @@ App.prototype.start_meteor = function(done){ this.meteor_process = spawn(command, args, { cwd: this.$.env.app.meteor, env: env, - // ignore on windows and them pipe stdout and sterr bellow - // spawning meteor with stdio=inherit on windows breaks things silently, - // not good mr windows - stdio: this.$.env.os.is_windows ? 'pipe' : 'inherit' + // pipe stdout and stderr below, because spawning meteor with stdio=inherit will: + // 1. break things silently on windows. + // 2. result in cpu usage on osx. + stdio: 'pipe', }); - if(this.$.env.os.is_windows) { - this.meteor_process.stdout.pipe(process.stdout); - this.meteor_process.stderr.pipe(process.stderr); - } + this.meteor_process.stdout.pipe(process.stdout); + this.meteor_process.stderr.pipe(process.stderr); var meteor_url = 'http://localhost:3000'; this.$.plugins.get('nodejs').meteor_ready(meteor_url, function(){ @@ -155,7 +153,7 @@ App.prototype.bundle_meteor = function( /* server_url, */ done) { App.prototype.ensure_deps = function(done) { this.log.info('ensuring electrify dependencies'); - + var npm_cmd = 'npm' + (this.$.env.os.is_windows ? '.cmd' : ''); // in development mode, use local electrify version