From 4866a4f8e4913118372d88d54a97fa25dcf88cbd Mon Sep 17 00:00:00 2001 From: Zach Gollwitzer Date: Thu, 12 Dec 2024 15:14:54 -0500 Subject: [PATCH] Increase cache time for upgrades Fixes #1525 --- app/models/provider/github.rb | 2 +- config/initializers/good_job.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/provider/github.rb b/app/models/provider/github.rb index 5aa8526a65d..51e2556c93a 100644 --- a/app/models/provider/github.rb +++ b/app/models/provider/github.rb @@ -8,7 +8,7 @@ def initialize(config = {}) end def fetch_latest_upgrade_candidates - Rails.cache.fetch("latest_github_upgrade_candidates", expires_in: 2.minutes) do + Rails.cache.fetch("latest_github_upgrade_candidates", expires_in: 30.minutes) do Rails.logger.info "Fetching latest GitHub upgrade candidates from #{repo} on branch #{branch}..." begin latest_release = Octokit.releases(repo).first diff --git a/config/initializers/good_job.rb b/config/initializers/good_job.rb index 5d8aae2505c..9ca92c0f964 100644 --- a/config/initializers/good_job.rb +++ b/config/initializers/good_job.rb @@ -4,7 +4,7 @@ if ENV["UPGRADES_ENABLED"] == "true" config.good_job.cron = { auto_upgrade: { - cron: "every 30 seconds", + cron: "every 2 minutes", class: "AutoUpgradeJob", description: "Check for new versions of the app and upgrade if necessary" }