feat(pipeline-task): add pipelineTaskEvent api.

This commit is contained in:
Ivan Li
2021-06-05 21:34:19 +08:00
parent 7091f9df6a
commit 20612d4301
7 changed files with 40 additions and 10 deletions

View File

@ -1,5 +1,6 @@
import { RabbitSubscribe } from '@golevelup/nestjs-rabbitmq';
import { Injectable, OnModuleDestroy } from '@nestjs/common';
import { plainToClass } from 'class-transformer';
import { Observable, Subject } from 'rxjs';
import { filter, publish, tap } from 'rxjs/operators';
import { PipelineTaskEvent } from './models/pipeline-task-event';
@ -19,7 +20,7 @@ export class PipelineTaskLogger implements OnModuleDestroy {
queue: QUEUE_HANDLE_PIPELINE_TASK_LOG_EVENT,
})
async handleEvent(message: PipelineTaskEvent) {
this.messageSubject.next(message);
this.messageSubject.next(plainToClass(PipelineTaskEvent, message));
}
getMessage$(taskId: string) {