@nger/fk-upload 1.0.192 → 1.0.195

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.
@@ -268,7 +268,13 @@ let TaskManageController = class TaskManageController {
268
268
  }
269
269
  }
270
270
  async finishTask(filename, callback, ctx) {
271
- await this.db.manager.update(entities_1.FkDownloadTaskEntity, filename, { status: 3 });
271
+ if (filename) {
272
+ const item = this.db.manager.findOne(entities_1.FkDownloadTaskEntity, { where: { filename } });
273
+ console.log({ filename, callback });
274
+ if (item) {
275
+ await this.db.manager.update(entities_1.FkDownloadTaskEntity, filename, { status: 3 });
276
+ }
277
+ }
272
278
  ctx.redirect(callback);
273
279
  }
274
280
  };
@@ -32,12 +32,8 @@ class ScheduleTask extends rabbitmq_1.Task {
32
32
  const uniacids = uniAccounts.map(a => a.uniacid);
33
33
  const tasks = await db.manager.find(entities_1.FkDownloadTaskEntity, { select: ['topicId'] });
34
34
  const ids = tasks.map(task => task.topicId);
35
- const now = new Date();
36
- const year = now.getFullYear();
37
- const month = now.getMonth();
38
- const day = now.getDate();
39
- const date = new Date(`${year}-${month + 1}-${day}`);
40
- const nowTime = Math.floor(date.getTime() / 1000);
35
+ const now = new Date().getTime() - 1000 * 60 * 60 * 24;
36
+ const nowTime = Math.floor(now / 1000);
41
37
  const where = {
42
38
  uniacid: (0, typeorm_2.In)(uniacids),
43
39
  createTime: (0, typeorm_2.MoreThan)(nowTime)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nger/fk-upload",
3
- "version": "1.0.192",
3
+ "version": "1.0.195",
4
4
  "description": "nger fk upload",
5
5
  "main": "dist/electon.js",
6
6
  "types": "dist/core.d.ts",