@nger/fk-upload 1.0.65 → 1.0.66

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.
@@ -20,11 +20,15 @@ class UploadTask extends rabbitmq_1.Task {
20
20
  const manager = injector.get(rabbitmq_1.TaskManager);
21
21
  const db = injector.get(typeorm_1.Db);
22
22
  const old = await db.manager.findOne(entities_1.FkDownloadTaskEntity, { where: { filename: task.filename } });
23
+ // not exist
24
+ if (!old) {
25
+ complete();
26
+ }
23
27
  // > 1G give up
24
28
  if (task.total >= 1024 * 1024 * 1024) {
25
29
  complete();
26
30
  }
27
- if (!(0, fs_1.existsSync)(task.path)) {
31
+ if (!(0, fs_1.existsSync)(task.path) || (old.fileMd5 && old.fileMd5.length > 0)) {
28
32
  await db.manager.update(entities_1.FkDownloadTaskEntity, task.filename, { status: 0 });
29
33
  complete();
30
34
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nger/fk-upload",
3
- "version": "1.0.65",
3
+ "version": "1.0.66",
4
4
  "description": "",
5
5
  "main": "dist/core.js",
6
6
  "types": "dist/core.d.ts",