@nger/fk-upload 1.0.55 → 1.0.56
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.
@@ -6,6 +6,7 @@ const actions_1 = require("./actions");
|
|
6
6
|
const typeorm_1 = require("@nger/typeorm");
|
7
7
|
const w7_1 = require("@nger/w7");
|
8
8
|
const entities_1 = require("../../entities");
|
9
|
+
const fs_extra_1 = require("fs-extra");
|
9
10
|
class EffectTask extends rabbitmq_1.Task {
|
10
11
|
constructor() {
|
11
12
|
super(actions_1.EFFECT_ACTION);
|
@@ -17,12 +18,14 @@ class EffectTask extends rabbitmq_1.Task {
|
|
17
18
|
const w7 = injector.get(w7_1.W7DataSource);
|
18
19
|
const db = injector.get(typeorm_1.Db);
|
19
20
|
await db.manager.update(entities_1.FkDownloadTaskEntity, task.filename, { status: 3 });
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
21
|
+
if (task.topicId) {
|
22
|
+
await (0, fs_extra_1.unlink)(task.path);
|
23
|
+
await w7.manager.update(w7_1.W7ChatTopicEntity, task.topicId, { thirdUrl: task.uploadUrl }).then(() => complete()).catch(() => fail());
|
24
|
+
complete();
|
25
|
+
}
|
26
|
+
else {
|
27
|
+
complete();
|
28
|
+
}
|
26
29
|
if (next)
|
27
30
|
await next();
|
28
31
|
}
|
@@ -155,7 +155,7 @@ let FkService = class FkService {
|
|
155
155
|
break;
|
156
156
|
}
|
157
157
|
if (uploadResult.code !== 200) {
|
158
|
-
console.log(uploadResult);
|
158
|
+
console.log(uploadResult, { size: end - start });
|
159
159
|
const info = await this.getUploadInfo(task.loginId, task.filename, task.fileMd5, task.total);
|
160
160
|
task.cookies = info.cookies;
|
161
161
|
task.splitSize = info.splitSize;
|