Skip to content
Snippets Groups Projects
Commit f13fe9ad authored by Vytor Calixto's avatar Vytor Calixto :space_invader:
Browse files

Add better cluster logs

parent a0da548f
No related branches found
No related tags found
2 merge requests!116Release v1.0.0,!39Cluster
Pipeline #
......@@ -15,6 +15,7 @@ if(cluster.isMaster) {
log.info(`Master ${process.pid} is running`);
const numCPUs = require('os').cpus().length;
log.info(`Master will create ${numCPUs} workers`);
for(let i=0; i < numCPUs; ++i) {
cluster.fork();
}
......@@ -35,8 +36,8 @@ if(cluster.isMaster) {
const server = app.listen(app.get('port'), () => {
log.info(`Express server listening on port ${server.address().port}`);
});
log.info(`Worker ${cluster.worker.id} is running`);
log.info(`Worker ${cluster.worker.id} is running (${process.pid})`);
// For testing
module.exports = server;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment