Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | 11x 11x 11x 11x | import { Processor, WorkerHost } from '@nestjs/bullmq';
import { Job } from 'bullmq';
import { BoostService } from '@app/modules/boost/boost.service';
import { Injectable, Logger } from '@nestjs/common';
interface EmptyPayload {}
@Processor('boost-expiry')
@Injectable()
export class BoostExpiryProcessor extends WorkerHost {
private readonly logger = new Logger(BoostExpiryProcessor.name);
constructor(private readonly boostService: BoostService) {
super();
}
async process(_job: Job<EmptyPayload>): Promise<void> {
const count = await this.boostService.expireBoosts();
this.logger.log(`Expired ${count} boosts`);
}
} |