Merge pull request #1710 from pandamicro/v1.5

Fix delayed sync task won’t trigger flow issue
This commit is contained in:
Wang Nan
2017-06-07 15:05:50 +08:00
committed by GitHub
+9 -1
View File
@@ -295,7 +295,15 @@ Downloader.prototype._handleLoadQueue = function () {
if (!nextOne) {
break;
}
this.handle(nextOne.item, nextOne.callback);
var syncRet = this.handle(nextOne.item, nextOne.callback);
if (syncRet !== undefined) {
if (syncRet instanceof Error) {
nextOne.callback(syncRet);
}
else {
nextOne.callback(null, syncRet);
}
}
}
};