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

proteus-cluster

Package Overview
Dependencies
Maintainers
3
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

proteus-cluster - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3

19

lib/cluster.js

@@ -159,7 +159,13 @@ /**

var workerIds = Object.keys(cluster.workers);
var workerResults = [];
var cmd = message && message.cmd;
if (!cmd) {
sendMessage(message);
res.statusCode = 200;
return res.end('OK');
res.writeHead(200, { 'Content-Type': 'application/json' });
for (var i = 0; i < workerIds.length; i++) {
workerResults.push('OK');
}
return res.end(JSON.stringify(workerResults));
}

@@ -172,3 +178,2 @@

var workerIds = Object.keys(cluster.workers);
addMessageListener(cmd, function(msg, worker) {

@@ -179,8 +184,10 @@ workerIds = workerIds.filter(function(v) {

workerResults.push(msg && msg.msg || '');
if (workerIds.length <= 0) {
clearTimeout(timer);
removeMessageListener(cmd);
res.statusCode = 200;
res.end('OK');
}
res.writeHead(200, { 'Content-Type': 'application/json' });
res.end(JSON.stringify(workerResults));
}
});

@@ -187,0 +194,0 @@

{
"name": "proteus-cluster",
"version": "1.1.2",
"version": "1.1.3",
"scripts": {

@@ -5,0 +5,0 @@ "start": "node app",

@@ -112,3 +112,5 @@ 'use strict';

res.on('data', function(chunk) {
expect('OK').to.eql(chunk);
var result = JSON.parse(chunk);
expect(result).to.be.an('array');
expect(result.length).to.eql(conf.worker);
});

@@ -115,0 +117,0 @@ res.on('end', function() {

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