mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-07 01:09:54 +08:00
feat(server): enable job queue log (#11390)
This commit is contained in:
@@ -72,9 +72,9 @@ export class JobExecutor implements OnModuleDestroy {
|
|||||||
|
|
||||||
const signature = `[${name}] (${handler.name})`;
|
const signature = `[${name}] (${handler.name})`;
|
||||||
try {
|
try {
|
||||||
this.logger.debug(`Job started: ${signature}`);
|
this.logger.log(`Job started: ${signature}`);
|
||||||
const ret = await handler.fn(payload);
|
const ret = await handler.fn(payload);
|
||||||
this.logger.debug(`Job finished: ${signature}`);
|
this.logger.log(`Job finished: ${signature}, signal=${ret}`);
|
||||||
return ret;
|
return ret;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.logger.error(`Job failed: ${signature}`, e);
|
this.logger.error(`Job failed: ${signature}`, e);
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export class JobQueue {
|
|||||||
const ns = namespace(name);
|
const ns = namespace(name);
|
||||||
const queue = this.getQueue(ns);
|
const queue = this.getQueue(ns);
|
||||||
const job = await queue.add(name, payload, opts);
|
const job = await queue.add(name, payload, opts);
|
||||||
this.logger.debug(`Job [${name}] added; id=${job.id}`);
|
this.logger.log(`Job [${name}] added; id=${job.id}`);
|
||||||
return job;
|
return job;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user