mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 17:15:03 -07:00
Limit background services by process role
This commit is contained in:
@@ -18,6 +18,10 @@ export class TelegramService implements OnModuleInit {
|
||||
private readonly configService: ConfigService,
|
||||
private readonly telegramSubscriptionsService: TelegramSubscriptionsService
|
||||
) {
|
||||
if (process.env.MASTER !== 'true') {
|
||||
return;
|
||||
}
|
||||
|
||||
const token: string | null = this.configService.get('TELEGRAM_BOT_TOKEN');
|
||||
if (token == null || token.length < 1) {
|
||||
return;
|
||||
@@ -32,6 +36,9 @@ export class TelegramService implements OnModuleInit {
|
||||
}
|
||||
|
||||
async onModuleInit(): Promise<void> {
|
||||
if (process.env.MASTER !== 'true') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.bot == null) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user