Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cluster-rolling-restart

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cluster-rolling-restart - npm Package Compare versions

Comparing version 1.0.10 to 1.0.12

npm-tile.png

20

index.js

@@ -72,10 +72,14 @@ "use strict";

* Control execution of stop/start request
* @returns {boolean} true to continue, otherwise stop
* @param {function()} callback - a callback that starts your app
* @param {number} waitms - Delay execution by `waitms`
* milliseconds so your app has time to start
*/
function continueReload(callback, waitms) {
if (
reloading ||
(workerList.length < numCores && callback.name.includes("start"))
) {
setTimeout(() => callback(), waitms);
const failedWorker =
!reloading &&
workerList.length < numCores &&
callback.name.includes("start");
if (reloading || failedWorker) {
setTimeout(callback, failedWorker ? 60000 : waitms);
}

@@ -107,3 +111,3 @@ }

console.log("worker down", worker.process.pid);
continueReload(startWorker, waitms);
continueReload(startWorker, 0);
});

@@ -114,3 +118,3 @@

console.log("worker up", worker.process.pid);
continueReload(stopWorker, 0);
continueReload(stopWorker, waitms);
});

@@ -117,0 +121,0 @@

2

package.json
{
"name": "cluster-rolling-restart",
"version": "1.0.10",
"version": "1.0.12",
"author": {

@@ -5,0 +5,0 @@ "name": "Tyson Midboe",

@@ -5,3 +5,3 @@ # cluster-rolling-restart

## Install
## Install [<img src="https://github.com/tysonrm/cluster-rolling-restart/blob/main/npm-tile.png">](https://www.npmjs.com/package/cluster-rolling-restart)

@@ -20,4 +20,4 @@ ```shell

app.get("/", (req, res) => res.send(`I'm pid ${process.pid}`));
app.get("/reload", (req, res) => process.send({ cmd: "reload" }));
app.get("/reload-reset", (req, res) => process.send({ cmd: "reload-reset" }));

@@ -24,0 +24,0 @@ cluster.startCluster(() => app.listen(8080));

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc