Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Commit 58b558a

Browse files
committed
cluster: allow env object to be passed to cluster.fork()
1 parent 6a83df0 commit 58b558a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/cluster.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,15 @@ function eachWorker(cb) {
140140
};
141141

142142

143-
cluster.fork = function() {
143+
cluster.fork = function(env) {
144144
// This can only be called from the master.
145145
assert(cluster.isMaster);
146146

147147
// Lazily start the master process stuff.
148148
startMaster();
149149

150150
var id = ++ids;
151-
var envCopy = {};
151+
var envCopy = env || {};
152152

153153
for (var x in process.env) {
154154
envCopy[x] = process.env[x];

0 commit comments

Comments
 (0)