File tree 2 files changed +3
-11
lines changed
2 files changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -108,9 +108,9 @@ module.exports = {
108
108
// clear instruction pool and as such there will be nothing next to execute
109
109
this . getPool ( payload . coords . ref ) . clear ( ) ;
110
110
111
- if ( ! this . hasPendingInstructions ( ) && ! this . __aborted ) {
112
- this . __aborted = true ;
113
-
111
+ // wait until all pools have been cleared, then trigger abort
112
+ this . __aborted = ( this . __aborted || 0 ) + 1 ;
113
+ if ( this . __aborted === _ . size ( this . pools ) ) {
114
114
this . triggers . abort ( null ) ;
115
115
116
116
// execute the userback sent as part of the command and do so in a try block
Original file line number Diff line number Diff line change @@ -189,14 +189,6 @@ _.assign(Run.prototype, {
189
189
return this . pools [ pid ] ;
190
190
} ,
191
191
192
- /**
193
- * @private
194
- * @return {Boolean }
195
- */
196
- hasPendingInstructions : function ( ) {
197
- return ! _ . isEmpty ( _ . pickBy ( this . pools , '_queue.length' ) ) ;
198
- } ,
199
-
200
192
/**
201
193
* @private
202
194
*
You can’t perform that action at this time.
0 commit comments