Skip to content

Commit 4fa9f71

Browse files
vkrolBYK
authored andcommitted
fix(install): Fix performance issue with multiple lifecycle package scripts (#4588)
**Summary** Fixes #4551. See #4551 (comment) **Test plan** * Existing tests pass * Manually tested
1 parent a3af477 commit 4fa9f71

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/util/blocking-queue.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ export default class BlockingQueue {
4545
}
4646

4747
this.stuckTimer = setTimeout(this.stuckTick, 5000);
48+
49+
// We need to check the existense of unref because of https://github.com/facebook/jest/issues/4559
50+
// $FlowFixMe: Node's setInterval returns a Timeout, not a Number
51+
this.stuckTimer.unref && this.stuckTimer.unref();
4852
}
4953

5054
stuckTick() {
@@ -79,6 +83,7 @@ export default class BlockingQueue {
7983
if (this.running[key]) {
8084
delete this.running[key];
8185
this.runningCount--;
86+
clearTimeout(this.stuckTimer);
8287

8388
if (this.warnedStuck) {
8489
this.warnedStuck = false;

0 commit comments

Comments
 (0)