mirror of https://github.com/nocodb/nocodb
Mert E
6 months ago
committed by
GitHub
6 changed files with 19 additions and 2679 deletions
File diff suppressed because it is too large
Load Diff
@ -1,30 +0,0 @@ |
|||||||
import { Process, Processor } from '@nestjs/bull'; |
|
||||||
import { Inject, Logger } from '@nestjs/common'; |
|
||||||
import { JOBS_QUEUE, JobTypes } from '~/interface/Jobs'; |
|
||||||
import { IJobsService } from '~/modules/jobs/jobs-service.interface'; |
|
||||||
|
|
||||||
@Processor(JOBS_QUEUE) |
|
||||||
export class HealthCheckProcessor { |
|
||||||
private logger = new Logger(HealthCheckProcessor.name); |
|
||||||
|
|
||||||
constructor( |
|
||||||
@Inject('JobsService') protected readonly jobsService: IJobsService, |
|
||||||
) {} |
|
||||||
|
|
||||||
@Process(JobTypes.HealthCheck) |
|
||||||
async healthCheck() { |
|
||||||
const queue = this.jobsService.jobsQueue; |
|
||||||
|
|
||||||
if (queue) { |
|
||||||
queue |
|
||||||
.getJobCounts() |
|
||||||
.then((stats) => { |
|
||||||
// log stats periodically
|
|
||||||
this.logger.log({ stats }); |
|
||||||
}) |
|
||||||
.catch((err) => { |
|
||||||
this.logger.error(err); |
|
||||||
}); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
Loading…
Reference in new issue