From 804460ad2d6d8c5581e12176f348967e100928ad Mon Sep 17 00:00:00 2001 From: Thomas Kortyka Date: Fri, 10 May 2024 23:55:47 +0200 Subject: [PATCH] chore: remove notify post route --- apps/azkaban-gateway/src/app/app.module.ts | 8 +----- .../src/app/notify/notify.controller.ts | 28 ------------------- .../src/app/notify/notify.module.ts | 7 ----- .../src/app/health/health.controller.ts | 1 - 4 files changed, 1 insertion(+), 43 deletions(-) delete mode 100644 apps/azkaban-gateway/src/app/notify/notify.controller.ts delete mode 100644 apps/azkaban-gateway/src/app/notify/notify.module.ts diff --git a/apps/azkaban-gateway/src/app/app.module.ts b/apps/azkaban-gateway/src/app/app.module.ts index 11ec9dfb..4774b50c 100644 --- a/apps/azkaban-gateway/src/app/app.module.ts +++ b/apps/azkaban-gateway/src/app/app.module.ts @@ -7,9 +7,8 @@ import { RouterModule } from '@nestjs/core'; import { ThrottlerModule } from '@nestjs/throttler'; import { GroupsModule } from './groups/groups.module'; import { VersionModule } from './version/version.module'; -import { ClientsModule, Transport } from '@nestjs/microservices'; +import { ClientsModule } from '@nestjs/microservices'; import { azkaban, clientProvider } from '@toxictoast/azkaban-broker-rabbitmq'; -import { NotifyModule } from './notify/notify.module'; @Module({ imports: [ @@ -43,7 +42,6 @@ import { NotifyModule } from './notify/notify.module'; UsersModule, GroupsModule, VersionModule, - NotifyModule, // RouterModule.register([ { @@ -70,10 +68,6 @@ import { NotifyModule } from './notify/notify.module'; path: 'version', module: VersionModule, }, - { - path: 'notify', - module: NotifyModule, - }, ]), ], }) diff --git a/apps/azkaban-gateway/src/app/notify/notify.controller.ts b/apps/azkaban-gateway/src/app/notify/notify.controller.ts deleted file mode 100644 index 5cd91f4a..00000000 --- a/apps/azkaban-gateway/src/app/notify/notify.controller.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { - Body, - Controller, - Get, - Inject, - Logger, - Param, - Post, - Query, - UseGuards, -} from '@nestjs/common'; -import { ThrottlerGuard } from '@nestjs/throttler'; -import { ClientRMQ } from '@nestjs/microservices'; -import { NotifyTopics } from '@toxictoast/azkaban-broker-rabbitmq'; - -@UseGuards(ThrottlerGuard) -@Controller() -export class NotifyController { - constructor(@Inject('AZKABAN_SERVICE') private readonly client: ClientRMQ) {} - - @Post() - async notify( - @Body('event') event: string, - @Body('data') data: unknown - ): Promise { - await this.client.emit(NotifyTopics.NOTIFY, { event, data }).toPromise(); - } -} diff --git a/apps/azkaban-gateway/src/app/notify/notify.module.ts b/apps/azkaban-gateway/src/app/notify/notify.module.ts deleted file mode 100644 index 8ef9029b..00000000 --- a/apps/azkaban-gateway/src/app/notify/notify.module.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Module } from '@nestjs/common'; -import { NotifyController } from './notify.controller'; - -@Module({ - controllers: [NotifyController], -}) -export class NotifyModule {} diff --git a/apps/azkaban-webhooks/src/app/health/health.controller.ts b/apps/azkaban-webhooks/src/app/health/health.controller.ts index 46c10ed3..e39f3186 100644 --- a/apps/azkaban-webhooks/src/app/health/health.controller.ts +++ b/apps/azkaban-webhooks/src/app/health/health.controller.ts @@ -36,7 +36,6 @@ export class HealthController { queue: azkaban, }, }), - () => this.database.pingCheck('postgres'), ]); } }