-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add cronjob controller for viewer and warcraft
- Loading branch information
1 parent
8d7f47a
commit 5d00a95
Showing
6 changed files
with
57 additions
and
13 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
apps/cronjob-service/src/app/cronjob/viewer/viewer.controller.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Controller, Logger } from '@nestjs/common'; | ||
import { EventPattern, MessagePattern } from '@nestjs/microservices'; | ||
import { CronjobTopics } from '@toxictoast/azkaban-broker-rabbitmq'; | ||
import { ViewerCron } from './viewer.cron'; | ||
|
||
@Controller('viewer') | ||
export class ViewerController { | ||
constructor(private readonly cronjob: ViewerCron) {} | ||
|
||
@EventPattern(CronjobTopics.VIEWER) | ||
async handleViewerCronjob(): Promise<void> { | ||
Logger.log('Received Viewer Cronjob', 'ViewerController'); | ||
await this.cronjob.runQueue(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
apps/cronjob-service/src/app/cronjob/warcraft/warcraft.controller.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Controller, Logger } from '@nestjs/common'; | ||
import { MessagePattern } from '@nestjs/microservices'; | ||
import { CronjobTopics } from '@toxictoast/azkaban-broker-rabbitmq'; | ||
import { WarcraftCron } from './warcraft.cron'; | ||
|
||
@Controller('warcraft') | ||
export class WarcraftController { | ||
constructor(private readonly cronjob: WarcraftCron) {} | ||
|
||
@MessagePattern(CronjobTopics.WARCRAFT) | ||
async handleWarcraftCronjob(): Promise<void> { | ||
Logger.log('Received Warcraft Cronjob', 'WarcraftController'); | ||
await this.cronjob.runQueue(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters