@nger/fk-upload 1.0.207 → 1.0.208
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/tasks/check-task.js +3 -5
- package/package.json +1 -1
package/dist/tasks/check-task.js
CHANGED
@@ -33,7 +33,6 @@ class CheckTask extends rabbitmq_1.Task {
|
|
33
33
|
complete();
|
34
34
|
return next && next();
|
35
35
|
}
|
36
|
-
console.log({ from, to, id, status: check.status });
|
37
36
|
const manager = injector.get(rabbitmq_1.TaskManager);
|
38
37
|
if (this.ids.has(id)) {
|
39
38
|
complete();
|
@@ -41,13 +40,12 @@ class CheckTask extends rabbitmq_1.Task {
|
|
41
40
|
}
|
42
41
|
if (check.status === '1') {
|
43
42
|
let job;
|
44
|
-
console.log(`work start ------- \n\n\n`);
|
45
43
|
this.ids.add(task.id);
|
46
44
|
const finish = async (reson) => {
|
47
45
|
this.ids.delete(check.id);
|
48
46
|
await db.manager.update(check_task_1.FkCheckTask, check.id, { status: `1`, desc: reson });
|
49
|
-
complete();
|
50
47
|
schedule.cancelJob(check.title);
|
48
|
+
complete();
|
51
49
|
};
|
52
50
|
const create = async () => {
|
53
51
|
const item = new rabbitmq_1.TaskEntity();
|
@@ -97,7 +95,6 @@ class CheckTask extends rabbitmq_1.Task {
|
|
97
95
|
const id = check.id;
|
98
96
|
const count = check.count;
|
99
97
|
async function run(time) {
|
100
|
-
console.log(time);
|
101
98
|
const runtimeCheck = await db.manager.findOne(check_task_1.FkCheckTask, { where: { id } });
|
102
99
|
if (!runtimeCheck) {
|
103
100
|
await finish(`人为关闭`);
|
@@ -107,13 +104,13 @@ class CheckTask extends rabbitmq_1.Task {
|
|
107
104
|
await finish(`人为关闭`);
|
108
105
|
return;
|
109
106
|
}
|
107
|
+
console.log({ time, from, to, id, status: runtimeCheck.status });
|
110
108
|
if (type === 'create_download') {
|
111
109
|
const now = new Date().getTime() - 1000 * 60 * 60 * 24 * 8;
|
112
110
|
(0, date_fns_1.format)(now, 'yyyy');
|
113
111
|
const _from = (0, date_fns_1.format)(now, 'yyyy-MM-dd HH:mm:ss');
|
114
112
|
const nowTime = Math.floor(now / 1000);
|
115
113
|
const downloads = await db.manager.find(download_task_1.FkDownloadTask, { where: { createDate: (0, typeorm_2.MoreThan)(_from) } });
|
116
|
-
console.log(downloads.length);
|
117
114
|
const ids = downloads.map(it => it.topicId).filter(it => !!it);
|
118
115
|
const where = { uniacid, createTime: (0, typeorm_2.MoreThan)(nowTime) };
|
119
116
|
if (ids.length > 0) {
|
@@ -184,6 +181,7 @@ class CheckTask extends rabbitmq_1.Task {
|
|
184
181
|
await finish(`未知任务`);
|
185
182
|
}
|
186
183
|
}
|
184
|
+
run(new Date());
|
187
185
|
job = schedule.scheduleJob(check.title, check.time, async (time) => {
|
188
186
|
run(time);
|
189
187
|
});
|