Skip to content

Commit

Permalink
Fixed issue with crashing server.
Browse files Browse the repository at this point in the history
  • Loading branch information
wbyoung committed Oct 14, 2014
1 parent 7893ceb commit 03ae3ea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion templates/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@ server.fork = (function() {
var run = function(app, env, cb) {
env = _.extend({}, process.env, env);
running = cp.fork(__filename, [app], { env: env });
running.on('close', function() { if (next) { next(); } });
running.on('close', function() {
running = undefined;
if (next) { next(); }
});
running.on('message', cb || function() {});
next = undefined;
};
Expand Down
5 changes: 4 additions & 1 deletion test/expected/gulpfile.full-stack.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@ server.fork = (function() {
var run = function(app, env, cb) {
env = _.extend({}, process.env, env);
running = cp.fork(__filename, [app], { env: env });
running.on('close', function() { if (next) { next(); } });
running.on('close', function() {
running = undefined;
if (next) { next(); }
});
running.on('message', cb || function() {});
next = undefined;
};
Expand Down

0 comments on commit 03ae3ea

Please sign in to comment.