From 5df4349cb311cba439b282ad8b259435d5513bf9 Mon Sep 17 00:00:00 2001 From: HUAHUAI23 Date: Fri, 2 Feb 2024 04:18:48 +0000 Subject: [PATCH] fix(server): add environment variable to control bucket domain Create task switch --- server/src/constants.ts | 4 ++++ server/src/gateway/bucket-domain-task.service.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/server/src/constants.ts b/server/src/constants.ts index f541ab8081..471d3aaf5b 100644 --- a/server/src/constants.ts +++ b/server/src/constants.ts @@ -35,6 +35,10 @@ export class ServerConfig { return process.env.DISABLED_GATEWAY_TASK === 'true' } + static get DISABLED_BUCKET_DOMAIN_TASK() { + return process.env.DISABLED_BUCKET_DOMAIN_TASK === 'true' + } + static get DISABLED_TRIGGER_TASK() { return process.env.DISABLED_TRIGGER_TASK === 'true' } diff --git a/server/src/gateway/bucket-domain-task.service.ts b/server/src/gateway/bucket-domain-task.service.ts index d2e0969e09..84f8412c60 100644 --- a/server/src/gateway/bucket-domain-task.service.ts +++ b/server/src/gateway/bucket-domain-task.service.ts @@ -20,7 +20,7 @@ export class BucketDomainTaskService { @Cron(CronExpression.EVERY_SECOND) async tick() { - if (ServerConfig.DISABLED_GATEWAY_TASK) return + if (ServerConfig.DISABLED_BUCKET_DOMAIN_TASK) return // Phase `Creating` -> `Created` this.handleCreatingPhase().catch((err) => {