Skip to content

Commit

Permalink
remove keep alive
Browse files Browse the repository at this point in the history
  • Loading branch information
Asing1001 committed Jun 2, 2024
1 parent 2aa8f17 commit d14e9c5
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 18 deletions.
7 changes: 0 additions & 7 deletions src/backgroundService/scheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
1 change: 0 additions & 1 deletion src/configs/systemSetting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
5 changes: 0 additions & 5 deletions terraform/gcp.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
5 changes: 0 additions & 5 deletions terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down

0 comments on commit d14e9c5

Please sign in to comment.