Skip to content

Commit

Permalink
fix(install): Fix performance issue with multiple lifecycle package s…
Browse files Browse the repository at this point in the history
…cripts (yarnpkg#4588)

**Summary**

Fixes yarnpkg#4551.

See yarnpkg#4551 (comment)

**Test plan**

* Existing tests pass
* Manually tested
  • Loading branch information
vkrol authored and joaolucasl committed Oct 27, 2017
1 parent 84e7705 commit fac465a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/util/blocking-queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ export default class BlockingQueue {
}

this.stuckTimer = setTimeout(this.stuckTick, 5000);

// We need to check the existense of unref because of https://github.com/facebook/jest/issues/4559
// $FlowFixMe: Node's setInterval returns a Timeout, not a Number
this.stuckTimer.unref && this.stuckTimer.unref();
}

stuckTick() {
Expand Down Expand Up @@ -79,6 +83,7 @@ export default class BlockingQueue {
if (this.running[key]) {
delete this.running[key];
this.runningCount--;
clearTimeout(this.stuckTimer);

if (this.warnedStuck) {
this.warnedStuck = false;
Expand Down

0 comments on commit fac465a

Please sign in to comment.