Closed leizha closed 10 years ago
the workaround for now is
{exec: ' ', execArgv: [ 'worker.js', '--config...' ]}
Does the args
options work instead of execArgv
? The former is for arguments to your worker, and the other is arguments to Node.js itself.
nope, once I changed it to args
, print process.argv in work gave me this
worker [ '/Users/leizha/.nvm/v0.10.26/bin/node', '/Users/leizha/Uber/ramen/server/node_modules/nanny/_worker' ]
Yeah, this is a bug. I’ll fix. I’m introducing a workerArgv option.
I was trying to start the worker with --config argument
var supervisor = new ClusterSupervisor({ exec: path.join(__dirname, "worker.js"), execArgv: [ '--config=' + path.join(__dirname, 'config/cluster.json') ], logicalIds: _.range(workerCount), createEnvironment: function(logicalId) { return _.defaults({ PROCESS_LOGICAL_ID: logicalId }, process.env); } });
It failed with
Try --help for options Error: unrecognized flag --config=/Users/leizha/Uber/ramen/server/config/cluster.json
I think the reason was that when execArgv was set, it overwrote the first argument which was worker.js