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

think-cluster

Package Overview
Dependencies
Maintainers
5
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

think-cluster - npm Package Compare versions

Comparing version 1.4.2 to 1.5.0

30

lib/master.js

@@ -138,4 +138,4 @@ const cluster = require('cluster');

server.listen(this.options.port, this.options.host, () => {
this.forkWorkers().then(() => {
deferred.resolve();
this.forkWorkers().then(data => {
deferred.resolve(data);
});

@@ -146,7 +146,29 @@ });

/**
* send inspect port
* @param {Worker} worker
*/
sendInspectPort(worker) {
const inspect = process.execArgv.some(item => item.indexOf('--inspect') >= 0);
if (!inspect) return;
const spawnargs = worker.process.spawnargs;
let port;
spawnargs.some(item => {
let match;
if (item.indexOf('--inspect') >= 0 && (match = item.match(/\d+/))) {
port = match[0];
}
});
if (port) {
process.send({act: 'inspectPort', port});
}
}
/**
* start server, support sticky
*/
startServer() {
if (!this.options.sticky) return this.forkWorkers();
return this.createServer();
const promise = !this.options.sticky ? this.forkWorkers() : this.createServer();
return promise.then(data => {
this.sendInspectPort(data[0].worker);
return data;
});
}

@@ -153,0 +175,0 @@ }

5

package.json
{
"name": "think-cluster",
"description": "Cluster manage for ThinkJS",
"version": "1.4.2",
"version": "1.5.0",
"author": {

@@ -12,3 +12,4 @@ "name": "welefen",

"test-cov": "nyc ava test/mock-test/ && nyc report --reporter=html",
"lint": "eslint ./lib/ index.js"
"lint": "eslint ./lib/ index.js",
"prepublish": "npm test"
},

@@ -15,0 +16,0 @@ "contributors": [

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