Skip to content

Commit

Permalink
replace fork with spawn
Browse files Browse the repository at this point in the history
  • Loading branch information
vmarchaud committed Jul 13, 2016
1 parent a7292de commit 0f2ecdd
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const EventEmitter = require('events');
const assert = require('assert');
const dgram = require('dgram');
const fork = require('child_process').fork;
const spawn = require('child_process').spawn;
const net = require('net');
const util = require('util');

Expand Down Expand Up @@ -319,11 +319,10 @@ function masterInit() {
execArgv[i] = match[1] + '=' + debugPort;
}
}

return fork(cluster.settings.exec, cluster.settings.args, {
return require('child_process').spawn("node", [cluster.settings.exec], {
env: workerEnv,
silent: cluster.settings.silent,
execArgv: execArgv,
stdio: ['pipe', 'pipe', 'pipe', 'ipc'],
detached: true,
gid: cluster.settings.gid,
uid: cluster.settings.uid
});
Expand Down

0 comments on commit 0f2ecdd

Please sign in to comment.