feat(pipelines): list logs 时提供关联的 tasks 。
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
import { Args, Mutation, Query, Resolver, Subscription } from '@nestjs/graphql';
|
||||
import { Args, Mutation, Query, Resolver } from '@nestjs/graphql';
|
||||
import { CreatePipelineInput } from './dtos/create-pipeline.input';
|
||||
import { UpdatePipelineInput } from './dtos/update-pipeline.input';
|
||||
import { Pipeline } from './pipeline.entity';
|
||||
import { PipelinesService } from './pipelines.service';
|
||||
import { ListPipelineArgs } from './dtos/list-pipelines.args';
|
||||
import { LogList } from '../repos/dtos/log-list.model';
|
||||
|
||||
@Resolver()
|
||||
export class PipelinesResolver {
|
||||
@@ -42,16 +41,4 @@ export class PipelinesResolver {
|
||||
async deletePipeline(@Args('id', { type: () => String }) id: string) {
|
||||
return await this.service.remove(id);
|
||||
}
|
||||
|
||||
@Subscription(() => LogList, {
|
||||
resolve: (value) => {
|
||||
return value;
|
||||
},
|
||||
})
|
||||
async listLogsForPipeline(@Args('id', { type: () => String }) id: string) {
|
||||
const job = await this.service.listLogsForPipeline(id);
|
||||
return (async function* () {
|
||||
yield await job.finished();
|
||||
})();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user