fennec-be/src/repos/list-logs.consumer.ts
Ivan Li cba4c0464c feat(pipelines): list commit logs 使用直接订阅。
替代了先查询再订阅,确保数据不丢失。
2021-03-10 21:41:47 +08:00

15 lines
493 B
TypeScript

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;
}
}