@nger/fk-upload 1.0.92 → 1.0.95
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/dist/main.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.CheckTask = void 0;
|
4
|
+
const task_service_1 = require("./task.service");
|
4
5
|
const fk_download_task_entity_1 = require("./../../entities/fk-download-task.entity");
|
5
6
|
const typeorm_1 = require("@nger/typeorm");
|
6
7
|
const actions_1 = require("./actions");
|
@@ -15,7 +16,8 @@ class CheckTask extends rabbitmq_1.Task {
|
|
15
16
|
const data = injector.get(rabbitmq_1.DATA);
|
16
17
|
const complete = injector.get(rabbitmq_1.COMPLETE);
|
17
18
|
const db = injector.get(typeorm_1.Db);
|
18
|
-
const task = injector.get(
|
19
|
+
const task = injector.get(task_service_1.TaskService);
|
20
|
+
const manager = injector.get(rabbitmq_1.TaskManager);
|
19
21
|
const filename = data.filename;
|
20
22
|
if (filename) {
|
21
23
|
const finishs = await db.manager.findOne(fk_download_task_entity_1.FkDownloadTaskEntity, { where: { filename } });
|
@@ -25,7 +27,10 @@ class CheckTask extends rabbitmq_1.Task {
|
|
25
27
|
await complete();
|
26
28
|
}
|
27
29
|
else {
|
28
|
-
|
30
|
+
await db.manager.update(fk_download_task_entity_1.FkDownloadTaskEntity, filename, { status: 0 });
|
31
|
+
const item = await task.createDownLoadTask(finishs.url, finishs.loginId, finishs.topicId);
|
32
|
+
await manager.send(item);
|
33
|
+
// redownload
|
29
34
|
await complete();
|
30
35
|
}
|
31
36
|
}
|
@@ -162,9 +162,10 @@ let FkService = class FkService {
|
|
162
162
|
task.uploadUrl = fullUrl;
|
163
163
|
}
|
164
164
|
}
|
165
|
-
console.log(`uploading ${task.filename} ${Math.floor((index + 1 / task.totalChunks))}%`)
|
165
|
+
// console.log(`uploading ${task.filename} ${Math.floor((index + 1 / task.totalChunks))}%`)
|
166
166
|
index = index + 1;
|
167
167
|
} while (!complete);
|
168
|
+
index = 0;
|
168
169
|
// upload complete
|
169
170
|
axios_1.default.post(`https://smr00.vip.webportal.top/ajax/advanceUpload.jsp?cmd=_report&_TOKEN=${task.token}`, this.encodeURIComponent({
|
170
171
|
type: 1,
|