diff --git a/config/default-0.json b/config/default-0.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/config/default-0.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/src/services/app.service.ts b/src/services/app.service.ts index 909713d..9af2afe 100644 --- a/src/services/app.service.ts +++ b/src/services/app.service.ts @@ -36,8 +36,10 @@ export class AppService implements OnModuleInit { } } - @Cron(CronExpression.EVERY_SECOND) + @Cron(CronExpression.EVERY_5_MINUTES) private async killDeadClients() { - await this.clientService.killDeadClients(); + if (process.env.NODE_APP_INSTANCE == null || process.env.NODE_APP_INSTANCE == '0') { + await this.clientService.killDeadClients(); + } } } \ No newline at end of file