@midwayjs/bull 3.12.8 → 3.13.0

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.
@@ -15,6 +15,11 @@ export declare const midwayLogger: {
15
15
  clients: {
16
16
  bullLogger: {
17
17
  fileLogName: string;
18
+ transports: {
19
+ file: {
20
+ fileLogName: string;
21
+ };
22
+ };
18
23
  };
19
24
  };
20
25
  };
@@ -21,6 +21,11 @@ exports.midwayLogger = {
21
21
  clients: {
22
22
  bullLogger: {
23
23
  fileLogName: 'midway-bull.log',
24
+ transports: {
25
+ file: {
26
+ fileLogName: 'midway-bull.log',
27
+ },
28
+ },
24
29
  },
25
30
  },
26
31
  };
package/dist/framework.js CHANGED
@@ -74,6 +74,9 @@ let BullFramework = class BullFramework extends core_1.BaseFramework {
74
74
  createQueue(name, queueOptions = {}) {
75
75
  const queue = new BullQueue(name, (0, core_1.extend)(true, {}, this.bullDefaultQueueConfig, queueOptions));
76
76
  this.queueMap.set(name, queue);
77
+ queue.on('error', err => {
78
+ this.app.getCoreLogger().error(err);
79
+ });
77
80
  return queue;
78
81
  }
79
82
  getQueue(name) {
@@ -96,18 +99,18 @@ let BullFramework = class BullFramework extends core_1.BaseFramework {
96
99
  job,
97
100
  from: processor,
98
101
  });
99
- ctx.logger.info(`start process job ${job.id} from ${processor.name}`);
100
- const isPassed = await this.app
101
- .getFramework()
102
- .runGuard(ctx, processor, 'execute');
103
- if (!isPassed) {
104
- throw new core_1.MidwayInvokeForbiddenError('execute', processor);
105
- }
106
- const service = await ctx.requestContext.getAsync(processor);
107
- const fn = await this.applyMiddleware(async (ctx) => {
108
- return await core_1.Utils.toAsyncFunction(service.execute.bind(service))(job.data, job);
109
- });
110
102
  try {
103
+ ctx.logger.info(`start process job ${job.id} from ${processor.name}`);
104
+ const isPassed = await this.app
105
+ .getFramework()
106
+ .runGuard(ctx, processor, 'execute');
107
+ if (!isPassed) {
108
+ throw new core_1.MidwayInvokeForbiddenError('execute', processor);
109
+ }
110
+ const service = await ctx.requestContext.getAsync(processor);
111
+ const fn = await this.applyMiddleware(async (ctx) => {
112
+ return await core_1.Utils.toAsyncFunction(service.execute.bind(service))(job.data, job);
113
+ });
111
114
  const result = await Promise.resolve(await fn(ctx));
112
115
  ctx.logger.info(`complete process job ${job.id} from ${processor.name}`);
113
116
  return result;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midwayjs/bull",
3
- "version": "3.12.8",
3
+ "version": "3.13.0",
4
4
  "description": "midway component for bull",
5
5
  "main": "dist/index.js",
6
6
  "typings": "index.d.ts",
@@ -24,14 +24,14 @@
24
24
  ],
25
25
  "license": "MIT",
26
26
  "devDependencies": {
27
- "@midwayjs/core": "^3.12.3",
28
- "@midwayjs/mock": "^3.12.8"
27
+ "@midwayjs/core": "^3.13.0",
28
+ "@midwayjs/mock": "^3.13.0"
29
29
  },
30
30
  "dependencies": {
31
- "bull": "4.11.3"
31
+ "bull": "4.11.4"
32
32
  },
33
33
  "engines": {
34
34
  "node": ">=12"
35
35
  },
36
- "gitHead": "598bf3584d655d41889237010edd8b3223d8f059"
36
+ "gitHead": "9f55734afa5b08dcf46bc89493ec8edaa8c6202b"
37
37
  }