2021-03-01 18:14:13 +08:00
|
|
|
import { Module } from '@nestjs/common';
|
|
|
|
import { PipelineTasksService } from './pipeline-tasks.service';
|
|
|
|
import { PipelineTasksResolver } from './pipeline-tasks.resolver';
|
|
|
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
|
|
|
import { PipelineTask } from './pipeline-task.entity';
|
|
|
|
import { Pipeline } from '../pipelines/pipeline.entity';
|
2021-03-04 11:43:23 +08:00
|
|
|
import { ReposModule } from '../repos/repos.module';
|
2021-03-06 12:23:55 +08:00
|
|
|
import { RedisModule } from 'nestjs-redis';
|
|
|
|
import { BullModule } from '@nestjs/bull';
|
2021-03-12 23:00:12 +08:00
|
|
|
import { PipelineTaskConsumer } from './pipeline-task.consumer';
|
2021-03-06 12:23:55 +08:00
|
|
|
import {
|
|
|
|
PIPELINE_TASK_QUEUE,
|
|
|
|
PIPELINE_TASK_LOG_QUEUE,
|
2021-03-15 13:30:52 +08:00
|
|
|
PIPELINE_TASK_LOG_PUBSUB,
|
2021-03-06 12:23:55 +08:00
|
|
|
} from './pipeline-tasks.constants';
|
2021-03-15 13:30:52 +08:00
|
|
|
import { PipelineTaskLogsService } from './pipeline-task-logs.service';
|
|
|
|
import { PubSub } from 'apollo-server-express';
|
2021-03-01 18:14:13 +08:00
|
|
|
|
|
|
|
@Module({
|
2021-03-06 12:23:55 +08:00
|
|
|
imports: [
|
|
|
|
TypeOrmModule.forFeature([PipelineTask, Pipeline]),
|
2021-03-27 15:34:08 +08:00
|
|
|
BullModule.registerQueue({
|
|
|
|
name: PIPELINE_TASK_QUEUE,
|
|
|
|
}),
|
2021-03-06 12:23:55 +08:00
|
|
|
RedisModule,
|
|
|
|
ReposModule,
|
|
|
|
],
|
2021-03-12 23:00:12 +08:00
|
|
|
providers: [
|
|
|
|
PipelineTasksService,
|
|
|
|
PipelineTasksResolver,
|
|
|
|
PipelineTaskConsumer,
|
2021-03-15 13:30:52 +08:00
|
|
|
PipelineTaskLogsService,
|
|
|
|
{
|
|
|
|
provide: Symbol(PIPELINE_TASK_LOG_PUBSUB),
|
|
|
|
useValue: new PubSub(),
|
|
|
|
},
|
2021-03-12 23:00:12 +08:00
|
|
|
],
|
2021-03-01 18:14:13 +08:00
|
|
|
})
|
|
|
|
export class PipelineTasksModule {}
|