@nger/fk-upload 1.0.45 → 1.0.48

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.
@@ -5,8 +5,6 @@ const rabbitmq_1 = require("@nger/rabbitmq");
5
5
  const actions_1 = require("./actions");
6
6
  const typeorm_1 = require("@nger/typeorm");
7
7
  const w7_1 = require("@nger/w7");
8
- const entities_1 = require("../../entities");
9
- const fs_extra_1 = require("fs-extra");
10
8
  class EffectTask extends rabbitmq_1.Task {
11
9
  constructor() {
12
10
  super(actions_1.EFFECT_ACTION);
@@ -17,14 +15,13 @@ class EffectTask extends rabbitmq_1.Task {
17
15
  const fail = injector.get(rabbitmq_1.FAIL);
18
16
  const w7 = injector.get(w7_1.W7DataSource);
19
17
  const db = injector.get(typeorm_1.Db);
20
- await db.manager.update(entities_1.FkDownloadTaskEntity, task.filename, { status: 3, uploadUrl: task.uploadUrl });
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
- }
25
- else {
26
- complete();
27
- }
18
+ // await db.manager.update(FkDownloadTaskEntity, task.filename, { status: 3, uploadUrl: task.uploadUrl });
19
+ // if (task.topicId) {
20
+ // await unlink(task.path);
21
+ // await w7.manager.update(W7ChatTopicEntity, task.topicId, { thirdUrl: task.uploadUrl }).then(() => complete()).catch(() => fail())
22
+ // } else {
23
+ // complete();
24
+ // }
28
25
  if (next)
29
26
  await next();
30
27
  }
@@ -31,10 +31,8 @@ class ScheduleTask extends rabbitmq_1.Task {
31
31
  const uids = users.map(user => user.uid);
32
32
  const uniAccounts = await w7.manager.find(w7_1.W7UniAccountEntity, { where: { createUid: (0, typeorm_2.In)(uids) } });
33
33
  const uniacids = uniAccounts.map(a => a.uniacid);
34
- console.log(`uniacids`, uniacids);
35
34
  const tasks = await db.manager.find(entities_1.FkDownloadTaskEntity, { select: ['topicId'] });
36
35
  const ids = tasks.map(task => task.topicId);
37
- console.log(`topic ids`, ids);
38
36
  const date = new Date('2022-05-10');
39
37
  const nowTime = Math.floor(date.getTime() / 1000);
40
38
  const where = {
@@ -45,8 +43,8 @@ class ScheduleTask extends rabbitmq_1.Task {
45
43
  where.id = (0, typeorm_2.Not)((0, typeorm_2.In)(ids));
46
44
  }
47
45
  const topics = await w7.manager.find(w7_1.W7ChatTopicEntity, { where });
48
- console.log(`topics`, topics);
49
- topics.map(async (topic) => {
46
+ console.log(`topics`, topics.length);
47
+ topics.filter(it => it.thirdUrl && it.thirdUrl.length > 0 && it.thirdUrl.endsWith('.mp4')).map(async (topic) => {
50
48
  if (topic.thirdUrl) {
51
49
  const uniacid = topic.uniacid;
52
50
  const account = uniAccounts.find(a => a.uniacid === uniacid);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nger/fk-upload",
3
- "version": "1.0.45",
3
+ "version": "1.0.48",
4
4
  "description": "",
5
5
  "main": "dist/core.js",
6
6
  "types": "dist/core.d.ts",