godaddy / node-cluster-service

Turn your single process code into a fault-resilient, multi-process service with built-in REST & CLI support. Restart or hot upgrade your web servers with zero downtime or impact to clients.

Home Page:https://www.npmjs.org/package/cluster-service

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Starting a worker shows: Worker undefined start, reason: restart

jsdevel opened this issue · comments

According to @asilvas, it should show pid / worker path.

Here's the output I get:

cservice:  Worker undefined start, reason: restart                                                                
cservice:  Worker undefined exited, reason: restart 

It would be better to show:

cservice:  Worker worker.js:34512 start, reason: restart                                                                
cservice:  Worker worker.js:34513 exited, reason: restart 

Here's my code:

//server.js
var cs = require('cluster-service');

cs.start({
  worker:"./worker.js"
});

//worker.js
var express = require('express');
var app = express();


app.get('/', function(req, res){
  res.send("hello");
});

app.listen(3000, function(){
  console.log("Listening on 3000");
});

Now displays worker filename(pid) start to avoid confusion with the pid being a port.