summaryrefslogtreecommitdiff
path: root/lib/auto.js
diff options
context:
space:
mode:
authorAlexander Early <alexander.early@gmail.com>2016-02-27 16:40:24 -0800
committerAlexander Early <alexander.early@gmail.com>2016-02-27 16:40:24 -0800
commit45e4d8c73c35401ac2c9eb2d600ac3a5c4e82fc9 (patch)
tree7239fde2d510164aca3ca9c0804446f1d4f50799 /lib/auto.js
parent73163c892b1f0f92b03ed47f4379dd0fb649a6a2 (diff)
downloadasync-45e4d8c73c35401ac2c9eb2d600ac3a5c4e82fc9.tar.gz
stop running tasks after an error. fixes #1023
Diffstat (limited to 'lib/auto.js')
-rw-r--r--lib/auto.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/auto.js b/lib/auto.js
index 21fbb08..0e9d108 100644
--- a/lib/auto.js
+++ b/lib/auto.js
@@ -72,6 +72,7 @@ export default function (tasks, concurrency, callback) {
});
safeResults[k] = args;
hasError = true;
+ listeners = [];
callback(err, safeResults);
}
@@ -106,7 +107,9 @@ export default function (tasks, concurrency, callback) {
}
function ready() {
- return runningTasks < concurrency && !baseHas(results, k) &&
+ return runningTasks < concurrency &&
+ !baseHas(results, k) &&
+ !hasError &&
arrayEvery(requires, function (x) {
return baseHas(results, x);
});