@nger/fk-upload 1.0.49 → 1.0.50

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.
@@ -37,12 +37,15 @@ class DownloadTask extends rabbitmq_1.Task {
37
37
  });
38
38
  let total = 0;
39
39
  let length = 0;
40
- let md5 = ``;
41
40
  console.log(`download ${url}`);
42
41
  const sub = new rxjs_1.Subject();
43
42
  sub.pipe((0, operators_1.throttleTime)(1000), (0, operators_1.switchMap)((size) => {
44
- return db.manager.update(entities_1.FkDownloadTaskEntity, task.filename, { size });
45
- })).subscribe();
43
+ return db.manager.update(entities_1.FkDownloadTaskEntity, task.filename, { totalSize: total, size });
44
+ })).subscribe({
45
+ next: () => { },
46
+ complete: () => {
47
+ }
48
+ });
46
49
  // get split size
47
50
  req.on('data', (buf) => {
48
51
  length += buf.length;
@@ -56,8 +59,7 @@ class DownloadTask extends rabbitmq_1.Task {
56
59
  writeStream.end();
57
60
  sub.complete();
58
61
  const fileMd5 = await (0, md5_file_1.default)(task.path);
59
- const isEqual = md5 === fileMd5;
60
- console.log(`file download success ${task.filename}, check result is ${isEqual}`);
62
+ console.log(`file download success ${task.filename}: ${fileMd5}`);
61
63
  const uploadTask = await this.createUploadTask(task, total, fileMd5, injector);
62
64
  await manager.send(uploadTask);
63
65
  complete();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nger/fk-upload",
3
- "version": "1.0.49",
3
+ "version": "1.0.50",
4
4
  "description": "",
5
5
  "main": "dist/core.js",
6
6
  "types": "dist/core.d.ts",