fennec-be/src/repos/list-logs.consumer.ts

15 lines
493 B
TypeScript
Raw Normal View History

import { ReposService } from './repos.service';
import { Processor, Process } from '@nestjs/bull';
import { Job } from 'bull';
import { ListLogsOption } from './models/list-logs.options';
import { LIST_LOGS_TASK } from './repos.constants';
@Processor(LIST_LOGS_TASK)
export class ListLogsConsumer {
constructor(private readonly service: ReposService) {}
@Process()
async listLogs(job: Job<ListLogsOption>) {
const logs = await this.service.listLogs(job.data);
return logs;
}
}