mirror of https://github.com/pelias/api.git
Peter Johnson a.k.a. insertcoffee
10 years ago
3 changed files with 18 additions and 13 deletions
@ -1,17 +1,20 @@ |
|||||||
|
|
||||||
var cluster = require('cluster'), |
var Cluster = require('cluster2'), |
||||||
app = require('./app'), |
app = require('./app'), |
||||||
multicore = false, |
port = ( process.env.PORT || 3100 ), |
||||||
port = ( process.env.PORT || 3100 ); |
multicore = true; |
||||||
|
|
||||||
/** cluster webserver across all cores **/ |
/** cluster webserver across all cores **/ |
||||||
// if( multicore ){
|
if( multicore ){ |
||||||
// @todo: not finished yet
|
var c = new Cluster({ port: port }); |
||||||
// cluster(app)
|
c.listen(function(cb){ |
||||||
// .use(cluster.stats())
|
console.log( 'worker: listening on ' + port ); |
||||||
// .listen( process.env.PORT || 3100 );
|
cb(app); |
||||||
// }
|
}); |
||||||
if (!multicore){ |
} |
||||||
|
|
||||||
|
/** run server on the default setup (single core) **/ |
||||||
|
else { |
||||||
console.log( 'listening on ' + port ); |
console.log( 'listening on ' + port ); |
||||||
app.listen( process.env.PORT || 3100 ); |
app.listen( port ); |
||||||
} |
} |
Loading…
Reference in new issue