Skip to content

Commit 1c5ea0a

Browse files
committed
Count aborted pools
1 parent 0fc1508 commit 1c5ea0a

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

lib/runner/extensions/control.command.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ module.exports = {
108108
// clear instruction pool and as such there will be nothing next to execute
109109
this.getPool(payload.coords.ref).clear();
110110

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)) {
114114
this.triggers.abort(null);
115115

116116
// execute the userback sent as part of the command and do so in a try block

lib/runner/run.js

-8
Original file line numberDiff line numberDiff line change
@@ -189,14 +189,6 @@ _.assign(Run.prototype, {
189189
return this.pools[pid];
190190
},
191191

192-
/**
193-
* @private
194-
* @return {Boolean}
195-
*/
196-
hasPendingInstructions: function () {
197-
return !_.isEmpty(_.pickBy(this.pools, '_queue.length'));
198-
},
199-
200192
/**
201193
* @private
202194
*

0 commit comments

Comments
 (0)