@midwayjs/bull 3.0.1 → 3.0.3
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.
|
@@ -7,8 +7,8 @@ exports.bull = {
|
|
|
7
7
|
},
|
|
8
8
|
contextLoggerApplyLogger: 'bullLogger',
|
|
9
9
|
contextLoggerFormat: info => {
|
|
10
|
-
const { jobId,
|
|
11
|
-
return `${info.timestamp} ${info.LEVEL} ${info.pid} [${jobId} ${
|
|
10
|
+
const { jobId, from } = info.ctx;
|
|
11
|
+
return `${info.timestamp} ${info.LEVEL} ${info.pid} [${jobId} ${from.name}}] ${info.message}`;
|
|
12
12
|
},
|
|
13
13
|
defaultConcurrency: 1,
|
|
14
14
|
clearJobWhenStart: true,
|
package/dist/framework.js
CHANGED
|
@@ -84,14 +84,14 @@ let BullFramework = class BullFramework extends core_1.BaseFramework {
|
|
|
84
84
|
job,
|
|
85
85
|
from: processor,
|
|
86
86
|
});
|
|
87
|
-
ctx.logger.info(`
|
|
87
|
+
ctx.logger.info(`start process job ${job.id} from ${processor.name}`);
|
|
88
88
|
const service = await ctx.requestContext.getAsync(processor);
|
|
89
89
|
const fn = await this.applyMiddleware(async (ctx) => {
|
|
90
90
|
return await decorator_1.Utils.toAsyncFunction(service.execute.bind(service))(job.data, job);
|
|
91
91
|
});
|
|
92
92
|
try {
|
|
93
93
|
const result = await Promise.resolve(await fn(ctx));
|
|
94
|
-
ctx.logger.info(`
|
|
94
|
+
ctx.logger.info(`complete process job ${job.id} from ${processor.name}`);
|
|
95
95
|
return result;
|
|
96
96
|
}
|
|
97
97
|
catch (err) {
|