Skip to content

Instantly share code, notes, and snippets.

@tim-kos
Created February 25, 2014 14:51
Show Gist options
  • Save tim-kos/0da0f2f6559646aa2076 to your computer and use it in GitHub Desktop.
Save tim-kos/0da0f2f6559646aa2076 to your computer and use it in GitHub Desktop.
var clusterMaster = require("cluster-master");
process.env.CLUSTER_MASTER_REPL = '7777';
clusterMaster({
exec : __dirname + "/server-worker.js",
size : 2,
env : process.env,
args : ["--deep", "doop"],
silent : false,
signals : false,
repl : false,
onMessage: function (msg) {
// console.error("Message from %s %j", this.uniqueID, msg);
}
});
setInterval(function() {
console.log("DOING RESTART");
clusterMaster.restart();
}, 10000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment