diff --git a/src/backgroundService/scheduler.ts b/src/backgroundService/scheduler.ts index 0782581..a18f50a 100644 --- a/src/backgroundService/scheduler.ts +++ b/src/backgroundService/scheduler.ts @@ -13,13 +13,6 @@ export function initScheduler() { return; } console.log('[Scheduler] init'); - if (systemSetting.keepAlive) { - setInterval(function () { - fetch(systemSetting.websiteUrl).then((res) => - console.log(`[Scheduler] Access to website:${systemSetting.websiteUrl}, status:${res.status}`) - ); - }, 600000); - } scheduleJob('10 * * * *', async function () { console.time('[Scheduler] updateLINEMovies'); diff --git a/src/configs/systemSetting.ts b/src/configs/systemSetting.ts index 71654b1..7615c79 100644 --- a/src/configs/systemSetting.ts +++ b/src/configs/systemSetting.ts @@ -4,7 +4,6 @@ export const systemSetting = { enableGraphiql: process.env.ENABLE_GRAPHIQL === 'true', enableScheduler: process.env.ENABLE_SCHEDULER === 'true', isProduction: process.env.NODE_ENV === 'production', - keepAlive: process.env.KEEP_ALIVE === 'true', redisUrlForApiCache: process.env.REDIS_URL || 'redis://localhost:6380/', redisUrlForScheduler: process.env.REDISCLOUD_URL || 'redis://localhost:6380/', taskTriggerKey: process.env.TASK_TRIGGER_KEY || 'taskTriggerKey', diff --git a/terraform/gcp.tf b/terraform/gcp.tf index 6c99997..ce954a8 100644 --- a/terraform/gcp.tf +++ b/terraform/gcp.tf @@ -67,11 +67,6 @@ resource "google_cloud_run_v2_service" "main" { value = var.node_env } - env { - name = "KEEP_ALIVE" - value = var.keep_alive - } - env { name = "REDIS_URL" value = "redis://default:${upstash_redis_database.main.password}@${upstash_redis_database.main.endpoint}:${upstash_redis_database.main.port}" diff --git a/terraform/variables.tf b/terraform/variables.tf index 7eff046..883a6ae 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -25,11 +25,6 @@ variable "node_env" { default = true } -variable "keep_alive" { - default = false - description = "whether to keep request the website_url to make it awake" -} - variable "website_url" { default = "" description = "if you set to true, the application will request website_url in every 15 seconds to keep it awake."