@nger/fk-upload 1.0.99 → 1.0.102
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.
@@ -102,7 +102,7 @@ let CheckUploadController = class CheckUploadController {
|
|
102
102
|
};
|
103
103
|
}
|
104
104
|
async checkFinish() {
|
105
|
-
const finishs = await this.db.manager.find(fk_download_task_entity_1.FkDownloadTaskEntity, { where: { status: 3 } });
|
105
|
+
const finishs = await this.db.manager.find(fk_download_task_entity_1.FkDownloadTaskEntity, { where: { status: (0, typeorm_2.In)([1, 2, 3]) } });
|
106
106
|
await Promise.all(finishs.map(finish => {
|
107
107
|
const item = new rabbitmq_1.TaskEntity();
|
108
108
|
item.topic = actions_1.CHECK_ACTION;
|
@@ -64,6 +64,8 @@ class DownloadTask extends rabbitmq_1.Task {
|
|
64
64
|
sub.complete();
|
65
65
|
const fileMd5 = await (0, md5_file_1.default)(task.path);
|
66
66
|
console.log(`file download success ${task.filename}: ${fileMd5}`);
|
67
|
+
const db = injector.get(typeorm_1.Db);
|
68
|
+
await db.manager.update(entities_1.FkDownloadTaskEntity, task.filename, { totalSize: total, fileMd5: fileMd5, status: 1, size: total });
|
67
69
|
const uploadTask = await this.createUploadTask(task, total, fileMd5, injector);
|
68
70
|
await manager.send(uploadTask);
|
69
71
|
await complete();
|
@@ -82,8 +84,6 @@ class DownloadTask extends rabbitmq_1.Task {
|
|
82
84
|
await next();
|
83
85
|
}
|
84
86
|
async createUploadTask(download, total, md5, injector) {
|
85
|
-
const db = injector.get(typeorm_1.Db);
|
86
|
-
await db.manager.update(entities_1.FkDownloadTaskEntity, download.filename, { totalSize: total, fileMd5: md5, status: 1, size: total });
|
87
87
|
const fk = injector.get(fk_service_1.FkService);
|
88
88
|
const info = await fk.getUploadInfo(download.loginId, download.filename, md5, total);
|
89
89
|
if (info) {
|