cluster-rolling-restart
Advanced tools
Comparing version
11
index.js
@@ -68,5 +68,5 @@ "use strict"; | ||
* const app = express(); | ||
* | ||
* | ||
* app.get("/", (req, res) => res.send(`<h1>Hi from pid ${process.pid}</h1>`)); | ||
* | ||
* | ||
* app.get("/reload", (req, res) => { | ||
@@ -76,12 +76,11 @@ * res.send("performing rolling restart of cluster"); | ||
* }); | ||
* | ||
* | ||
* function startServer(app) { | ||
* app.listen(8080); | ||
* } | ||
* | ||
* | ||
* cluster.startCluster(startServer, app); | ||
* ``` | ||
*/ | ||
module.exports.startCluster = function (startService, app, waitms = 2000) { | ||
module.exports.startCluster = function (startService, waitms = 2000) { | ||
if (cluster.isMaster) { | ||
@@ -88,0 +87,0 @@ // Worker stopped. If reloading, start a new one. |
{ | ||
"name": "cluster-rolling-restart", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"author": { | ||
@@ -5,0 +5,0 @@ "name": "Tyson Midboe", |
@@ -11,6 +11,6 @@ const express = require("express"); | ||
function startServer(app) { | ||
function startServer() { | ||
app.listen(8080); | ||
} | ||
require("../index").startCluster(startServer, app); | ||
require("../index").startCluster(startServer); |
6288
-0.29%