@nger/fk-upload 1.0.112 → 1.0.115
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.
@@ -84,7 +84,9 @@ let CheckUploadController = class CheckUploadController {
|
|
84
84
|
async checkWaitUploadTask() {
|
85
85
|
const download = this.db.manager.getRepository(fk_download_task_entity_1.FkDownloadTaskEntity);
|
86
86
|
const errors = await download.find({ where: { uploadUrl: (0, typeorm_2.Like)('https://site%') } });
|
87
|
-
|
87
|
+
if (errors && errors.length > 0) {
|
88
|
+
await download.update(errors.map(err => err.filename), { status: 1 });
|
89
|
+
}
|
88
90
|
const list = await download.find({ where: { status: 1, totalSize: (0, typeorm_2.LessThan)(1024 * 1024 * 1024) } });
|
89
91
|
const task = this.injector.get(task_service_1.TaskService);
|
90
92
|
await Promise.all(list.map(async (item) => {
|
@@ -77,6 +77,9 @@ class DownloadTask extends rabbitmq_1.Task {
|
|
77
77
|
await manager.send(uploadTask);
|
78
78
|
await complete();
|
79
79
|
});
|
80
|
+
req.on('error', async () => {
|
81
|
+
await fail();
|
82
|
+
});
|
80
83
|
req.on('response', async (resp) => {
|
81
84
|
const headers = resp.headers;
|
82
85
|
total = Number(headers["content-length"]);
|
@@ -75,6 +75,11 @@ class ScheduleTask extends rabbitmq_1.Task {
|
|
75
75
|
}
|
76
76
|
}
|
77
77
|
});
|
78
|
+
// check status = 1
|
79
|
+
const waitUploadTask = await db.manager.find(entities_1.FkDownloadTaskEntity, { where: { status: 1 } });
|
80
|
+
// waitUploadTask.map(task => {
|
81
|
+
// taskService.createUploadTask()
|
82
|
+
// })
|
78
83
|
};
|
79
84
|
await run();
|
80
85
|
schedule.scheduleJob(task.name, task.rule, async (time) => {
|
@@ -41,7 +41,9 @@ class UploadTask extends rabbitmq_1.Task {
|
|
41
41
|
await complete();
|
42
42
|
return next && next();
|
43
43
|
}
|
44
|
-
|
44
|
+
const cloudSize = await fk.getSize(old.url);
|
45
|
+
const localSize = fk.getLocalSize(old.path);
|
46
|
+
if (cloudSize != localSize) {
|
45
47
|
await db.manager.update(entities_1.FkDownloadTaskEntity, task.filename, { status: 0 });
|
46
48
|
const download = await taskService.createDownLoadTask(old.url, old.loginId, old.topicId);
|
47
49
|
await manager.send(download);
|