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

cluster2

Package Overview
Dependencies
Maintainers
6
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cluster2 - npm Package Compare versions

Comparing version 0.4.17 to 0.4.18

log/955.log

1

lib/index.js

@@ -85,2 +85,3 @@ /*

heartbeatInterval: options.heartbeatInterval,
maxHeartbeatDelay: options.maxHeartbeatDelay,
emitter: self

@@ -87,0 +88,0 @@ });

@@ -52,2 +52,4 @@ /*

this.options.maxHeartbeatDelay = options.maxHeartbeatDelay || 3*60000; //default 3 mins
this._heartbeats = [];

@@ -154,5 +156,8 @@

if(message.type === 'heartbeat'){
if(message.pid != process.pid){
self._heartbeats.push(message);//must append to the tail
// update the last heartbeat time for the worker
var workerStats = self.stats.workers[message.pid];
//console.log('heartbeat ' + process.pid);
workerStats.lastHeartbeatAt= Date.now();
}

@@ -199,2 +204,19 @@

self.lastTime = Date.now();
// Check the last heartbeat time of all the workers
_.each(self.stats.workers, function (workerStats, pid) {
var now = Date.now();
if (now - workerStats.lastHeartbeatAt> self.options.maxHeartbeatDelay) {
// this worker hasn't been sending heartbeat for maxHeartbeatDelay
log(util.format('[Cluster2] Detected worker%d is not responsive for %d', pid, now - workerStats.lastHeartbeatAt));
var deathQueue = require('./misc').deathQueue;
deathQueue(self.workers[pid], self.emitter, function () {
// create a successor
var successor = self.createWorker();
self.workers[successor.pid] = successor;
log(util.format('[Cluster2] Created a new worker with pid %d', successor.pid));
return successor;
});
}
});

@@ -464,2 +486,4 @@ }, self.options.heartbeatInterval || 60000);

// put the emitter in the process
process.emitter = self.emitter;
self.emitter.emit(signal, {

@@ -646,2 +670,4 @@ pid: process.pid,

}, self.options.heartbeatInterval || 60000);
// put the heartbeat interval id in the process context
process.heartbeat = heartbeat;

@@ -648,0 +674,0 @@ _.each(apps, function(app){

2

package.json

@@ -8,3 +8,3 @@ {

"name": "cluster2",
"version": "0.4.17",
"version": "0.4.18",
"repository": {

@@ -11,0 +11,0 @@ "type": "git",

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