@nger/fk-upload 1.0.121 → 1.0.122
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.
@@ -164,12 +164,6 @@ let FkService = class FkService {
|
|
164
164
|
}).catch(async (e) => {
|
165
165
|
throw e;
|
166
166
|
});
|
167
|
-
console.log(`upload ----- `, { index, max, start, end, uploadResult });
|
168
|
-
if (!uploadResult) {
|
169
|
-
complete = true;
|
170
|
-
index = 0;
|
171
|
-
break;
|
172
|
-
}
|
173
167
|
if (uploadResult.code !== 200) {
|
174
168
|
if (uploadResult.data) {
|
175
169
|
const data = uploadResult.data;
|
@@ -180,6 +174,7 @@ let FkService = class FkService {
|
|
180
174
|
}
|
181
175
|
throw new Error(`${task.filename}--${uploadResult.msg}`);
|
182
176
|
}
|
177
|
+
console.log(`upload ----- `, { index, max, start, end });
|
183
178
|
if (uploadResult) {
|
184
179
|
const data = uploadResult.data;
|
185
180
|
const downUrl = data.path;
|
@@ -25,6 +25,7 @@ class UploadTask extends rabbitmq_1.Task {
|
|
25
25
|
async handle(injector, next) {
|
26
26
|
const task = injector.get(rabbitmq_1.DATA);
|
27
27
|
const complete = injector.get(rabbitmq_1.COMPLETE);
|
28
|
+
const fail = injector.get(rabbitmq_1.FAIL);
|
28
29
|
const fk = injector.get(fk_service_1.FkService);
|
29
30
|
const taskService = injector.get(task_service_1.TaskService);
|
30
31
|
const manager = injector.get(rabbitmq_1.TaskManager);
|
@@ -66,10 +67,10 @@ class UploadTask extends rabbitmq_1.Task {
|
|
66
67
|
}
|
67
68
|
if (this.errorCount > 10) {
|
68
69
|
this.errorCount = 0;
|
69
|
-
return
|
70
|
+
return fail();
|
70
71
|
}
|
71
72
|
this.errorCount += 1;
|
72
|
-
console.log(`upload error ${this.errorCount}`, e);
|
73
|
+
console.log(`upload error ${this.errorCount}`, e.message);
|
73
74
|
throw e;
|
74
75
|
});
|
75
76
|
}
|