Closed bkw closed 13 years ago
resolve server path in worker sooner. Closed by 3816b6986d4f7a437d805c0278d08278cc2081aa [reported by bkw]
I'm having this same issue. My cluster.js
:
"use strict";
var cluster = require('cluster'),
config = require('./config'),
live = require('cluster-live'),
app = exports.app = require('./server').app;
cluster('./server')
.use(cluster.logger('/node/log'))
.use(cluster.pidfiles('/node/pids'))
.use(cluster.cli())
.use(cluster.reload())
.use(cluster.debug())
.use(cluster.repl(8889))
.use(cluster.stats({ connections: true, lightRequests: true }))
.use(live({"hostname": '123.45.68.9', "user": "user", "pass": "pass"}))
.listen(config.http_server_port, config.http_server_address);
getting this:
TypeError: Object #<Object> has no method 'on'
at stats (/node/node_modules/cluster/lib/plugins/stats.js:53:16)
at Master.use (/node/node_modules/cluster/lib/master.js:404:32)
at Object.<anonymous> (/node/cluster.js:15:3)
at Module._compile (module.js:402:26)
at Object..js (module.js:408:10)
at Module.load (module.js:334:31)
at Function._load (module.js:293:12)
at Array.<anonymous> (module.js:421:10)
at EventEmitter._tickCallback (node.js:126:26)
continuosly. It actually locked up my Rackspace cloudserver, had to call in to reboot it because CPU was at 100%.
Oh, wait! Damn, that's embarassing - I'm passing cluster a filename instead of defined variable. Sorry. Derp!
Seems the new connection option for the stats plugin only works if app is already initialized, not if it is given as a filename.