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

cluster-file-writer

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-file-writer - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

test/deathtest.log

39

lib/ClusterFileWriter.js

@@ -12,3 +12,8 @@ var fs = require('fs');

var worker = self._pausedWorkers.pop();
worker.send('cluster-file-writer-resume');
try {
worker.send('cluster-file-writer-resume');
} catch (e) {
console.log(e);
}
}

@@ -25,2 +30,22 @@ });

});
cluster.on('disconnect', function(worker) {
removeFromPausedWorkers(worker);
});
cluster.on('exit', function(worker, code, signal) {
removeFromPausedWorkers(worker);
});
function removeFromPausedWorkers(worker) {
for (var i = 0; i < self._pausedWorkers.length; i++) {
var pausedWorker = self._pausedWorkers[i];
if (pausedWorker.id = worker.id) {
self._pausedWorkers = self._pausedWorkers.splice(1, 1);
console.log('worker found and removed from paused');
break;
}
}
}
}

@@ -35,4 +60,8 @@

if (!resume) {
worker.send('cluster-file-writer-pause');
if (!resume) {
try {
worker.send('cluster-file-writer-pause');
} catch (e) {
console.log(e);
}
self._pausedWorkers.push(worker);

@@ -77,4 +106,3 @@ }

Worker.prototype._resume = function () {
this._paused = false;
//console.log('resuming', this.messageCount);
this._paused = false;
};

@@ -84,3 +112,2 @@

this._paused = true;
//console.log('pausing', this.messageCount);
};

@@ -87,0 +114,0 @@

2

package.json
{
"name": "cluster-file-writer",
"version": "0.0.3",
"version": "0.0.4",
"description": "write to a single file from a cluster",

@@ -5,0 +5,0 @@ "keywords": ["cluster", "logger", "filesystem", "file"],

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