File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ export default class BlockingQueue {
16
16
this . concurrencyQueue = [ ] ;
17
17
this . maxConcurrency = maxConcurrency ;
18
18
this . runningCount = 0 ;
19
+ this . warnedStuck = false ;
19
20
this . alias = alias ;
20
21
this . first = true ;
21
22
@@ -24,6 +25,7 @@ export default class BlockingQueue {
24
25
}
25
26
26
27
concurrencyQueue : Array < Function > ;
28
+ warnedStuck : boolean ;
27
29
maxConcurrency : number ;
28
30
runningCount : number ;
29
31
stuckTimer : ?number ;
@@ -49,6 +51,7 @@ export default class BlockingQueue {
49
51
50
52
this . stuckTimer = setTimeout ( ( ) => {
51
53
if ( this . runningCount === 1 ) {
54
+ this . warnedStuck = true ;
52
55
console . warn (
53
56
`[fbkpm] The ${ JSON . stringify ( this . alias ) } blocking queue may be stuck. 5 seconds ` +
54
57
`without any activity with 1 worker: ${ Object . keys ( this . running ) [ 0 ] } `
@@ -79,6 +82,13 @@ export default class BlockingQueue {
79
82
if ( this . running [ key ] ) {
80
83
delete this . running [ key ] ;
81
84
this . runningCount -- ;
85
+
86
+ if ( this . warnedStuck ) {
87
+ this . warnedStuck = false ;
88
+ console . log (
89
+ `[fbkpm] ${ JSON . stringify ( this . alias ) } blocking queue finally resolved. Nothing to worry about.`
90
+ ) ;
91
+ }
82
92
}
83
93
84
94
let queue = this . queue [ key ] ;
You can’t perform that action at this time.
0 commit comments