@nger/fk-upload 1.0.63 → 1.0.64
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.
@@ -156,12 +156,13 @@ let FkService = class FkService {
|
|
156
156
|
if (downUrl) {
|
157
157
|
if (downUrl.startsWith('https://site-upload')) {
|
158
158
|
console.log(`upload fail`);
|
159
|
+
throw new Error(`need re bind`);
|
159
160
|
}
|
160
161
|
const fullUrl = downUrl.startsWith('http') ? downUrl : `https:` + downUrl;
|
161
162
|
task.uploadUrl = fullUrl;
|
162
163
|
}
|
163
164
|
}
|
164
|
-
console.log(`uploading ${Math.floor((index + 1 / task.totalChunks) * 100)}%`);
|
165
|
+
console.log(`uploading ${task.filename} ${Math.floor((index + 1 / task.totalChunks) * 100)}%`);
|
165
166
|
index = index + 1;
|
166
167
|
} while (!complete);
|
167
168
|
// upload complete
|
@@ -15,7 +15,6 @@ class UploadTask extends rabbitmq_1.Task {
|
|
15
15
|
async handle(injector, next) {
|
16
16
|
const task = injector.get(rabbitmq_1.DATA);
|
17
17
|
const complete = injector.get(rabbitmq_1.COMPLETE);
|
18
|
-
const fail = injector.get(rabbitmq_1.FAIL);
|
19
18
|
const fk = injector.get(fk_service_1.FkService);
|
20
19
|
const taskService = injector.get(task_service_1.TaskService);
|
21
20
|
const manager = injector.get(rabbitmq_1.TaskManager);
|
@@ -29,8 +28,9 @@ class UploadTask extends rabbitmq_1.Task {
|
|
29
28
|
}
|
30
29
|
await fk.startUploadFile(task).then(async (res) => {
|
31
30
|
// create effect task
|
31
|
+
console.log(`upload success`, res.filename);
|
32
32
|
await db.manager.update(entities_1.FkDownloadTaskEntity, task.filename, { status: 2, uploadUrl: task.uploadUrl, uploadSize: task.total, uploadStatus: 1 });
|
33
|
-
const effectTask = await taskService.createEffectTask(
|
33
|
+
const effectTask = await taskService.createEffectTask(res.filename, res.uploadUrl, task.topicId, task.path);
|
34
34
|
return manager.send(effectTask).then(() => complete());
|
35
35
|
});
|
36
36
|
if (next)
|