Socket
Socket
Sign inDemoInstall

thread-loader

Package Overview
Dependencies
291
Maintainers
9
Versions
25
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.1.1 to 2.1.2

10

CHANGELOG.md

@@ -5,2 +5,12 @@ # Change Log

<a name="2.1.2"></a>
## [2.1.2](https://github.com/webpack-contrib/thread-loader/compare/v2.1.1...v2.1.2) (2019-01-25)
### Bug Fixes
* lifecycle handling for signals
<a name="2.1.1"></a>

@@ -7,0 +17,0 @@ ## [2.1.1](https://github.com/webpack-contrib/thread-loader/compare/v2.1.0...v2.1.1) (2018-12-21)

35

dist/WorkerPool.js

@@ -294,22 +294,15 @@ 'use strict';

terminate(force) {
if (!this.terminated) {
this.terminated = true;
terminate() {
if (this.terminated) {
return;
}
this.poolQueue.kill();
this.disposeWorkers(force);
}
this.terminated = true;
this.poolQueue.kill();
this.disposeWorkers(true);
}
setupLifeCycle() {
process.on('SIGTERM', () => {
this.terminate(true);
});
process.on('SIGINT', () => {
this.terminate(true);
});
process.on('exit', () => {
this.terminate(true);
this.terminate();
});

@@ -366,4 +359,9 @@ }

disposeWorkers(force) {
if (this.activeJobs === 0 || force) {
disposeWorkers(fromTerminate) {
if (!this.options.poolRespawn && !fromTerminate) {
this.terminate();
return;
}
if (this.activeJobs === 0 || fromTerminate) {
for (const worker of this.workers) {

@@ -374,7 +372,4 @@ worker.dispose();

}
if (!this.options.poolRespawn) {
this.terminate();
}
}
}
exports.default = WorkerPool;
{
"name": "thread-loader",
"version": "2.1.1",
"version": "2.1.2",
"description": "Runs the following loaders in a worker pool",

@@ -5,0 +5,0 @@ "author": "Tobias Koppers @sokra",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc