node-automator 1.3.9 → 1.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/commands/ali_oss.js +2 -2
- package/package.json +1 -1
- package/utils/func_tool.js +5 -5
package/commands/ali_oss.js
CHANGED
|
@@ -155,9 +155,9 @@ class AliOssCommand extends BaseCommand {
|
|
|
155
155
|
timeout,
|
|
156
156
|
});
|
|
157
157
|
});
|
|
158
|
-
queueAsync(tasks, concurrency, (done, total, index,
|
|
158
|
+
queueAsync(tasks, concurrency, (done, total, index, ret) => {
|
|
159
159
|
progress(done, total, {
|
|
160
|
-
desc: path.relative(base, srcs[index]) + " " + (
|
|
160
|
+
desc: path.relative(base, srcs[index]) + " " + (ret ? (ret.err ? "上传失败!" : "上传成功!") : "上传中..."),
|
|
161
161
|
depth: 0,
|
|
162
162
|
});
|
|
163
163
|
}).then((result) => {
|
package/package.json
CHANGED
package/utils/func_tool.js
CHANGED
|
@@ -67,8 +67,8 @@ function queueAsync(tasks, limit, onProgress) {
|
|
|
67
67
|
if (!tasks.length) resolve(result);
|
|
68
68
|
var index = 0;
|
|
69
69
|
var numDone = 0;
|
|
70
|
-
function checkDone(doneIndex) {
|
|
71
|
-
onProgress && onProgress(numDone, tasks.length, doneIndex,
|
|
70
|
+
function checkDone(doneIndex, ret) {
|
|
71
|
+
onProgress && onProgress(numDone, tasks.length, doneIndex, ret);
|
|
72
72
|
if (numDone == tasks.length) {
|
|
73
73
|
resolve(result);
|
|
74
74
|
return;
|
|
@@ -80,19 +80,19 @@ function queueAsync(tasks, limit, onProgress) {
|
|
|
80
80
|
function _run() {
|
|
81
81
|
const currIndex = index++;
|
|
82
82
|
const task = tasks[currIndex];
|
|
83
|
-
onProgress && onProgress(numDone, tasks.length, currIndex
|
|
83
|
+
onProgress && onProgress(numDone, tasks.length, currIndex);
|
|
84
84
|
task().then(function (val) {
|
|
85
85
|
numDone++;
|
|
86
86
|
result.push({
|
|
87
87
|
val,
|
|
88
88
|
});
|
|
89
|
-
checkDone(currIndex);
|
|
89
|
+
checkDone(currIndex, { val });
|
|
90
90
|
}).catch(function (err) {
|
|
91
91
|
numDone++;
|
|
92
92
|
result.push({
|
|
93
93
|
err,
|
|
94
94
|
});
|
|
95
|
-
checkDone(currIndex);
|
|
95
|
+
checkDone(currIndex, { err });
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
98
|
for(var i = 0; i < tasks.length && i < limit; i++) {
|