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

forkie

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

forkie - npm Package Compare versions

Comparing version 1.1.1 to 1.2.0

13

lib/master.js

@@ -11,3 +11,2 @@ 'use strict';

var repl;
var manualRestart;
var shutdown;

@@ -43,2 +42,4 @@

workers = toFork.map(function(what) {
var manualRestart;
return {

@@ -147,2 +148,5 @@ id: forks.push(null) - 1,

repl = require('./repl.js')(masterWorker, workers, opts.repl);
repl.on('listening', function emitREPLAddress() {
masterWorker.emit('repl', this.address());
});
}

@@ -274,3 +278,8 @@

forks[clusterWorker.id].once('exit', function(code, signal) {
if (code === 0 && !signal) {
// if `signal` is defined, it means
// - master killed the worker
// - someone from the outside killed the worker
// In both cases, we do not want to restart the worker
// If you want to restart the worker, use the REPL
if (code === 0 || signal) {
return;

@@ -277,0 +286,0 @@ }

2

package.json
{
"name": "forkie",
"version": "1.1.1",
"version": "1.2.0",
"description": "forkie likes your forks",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -434,2 +434,23 @@ describe('creating a graceful master process', function () {

describe('when fork exits with 1 and a signal was sent', function(done) {
beforeEach(function () {
forks[0].emit('exit', 1, 'SIGKILL');
// restart timeout
this.clock.tick(1000);
});
it('do not call fork again', function() {
expect(fakeCp.fork).to.be.calledOnce;
});
it('does not sends a restarted event', function() {
expect(workerEmit).to.not.be.calledWithExactly('worker restarted', {
id: 0,
toFork: 'a-restarted-module.js',
restarts: { manual: 0, automatic: 1 }
});
});
});
describe('when fork exits with 0', function(done) {

@@ -440,7 +461,7 @@ beforeEach(function () {

it('do not call fork again', function() {
it('does not call fork again', function() {
expect(fakeCp.fork).to.be.calledOnce;
});
it('sends a restarted event', function() {
it('does not sends a restarted event', function() {
expect(workerEmit).to.not.be.calledWithExactly('worker restarted', {

@@ -447,0 +468,0 @@ id: 0,

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