From 8cd90cef0d35f6305485d2a955752ba07c7a1cc0 Mon Sep 17 00:00:00 2001 From: Tristan Hill Date: Mon, 19 Feb 2024 18:00:23 +0000 Subject: [PATCH] branch with just s3 caching --- Gemfile | 2 ++ Gemfile.lock | 10 ++++++++++ config/environments/production.rb | 3 ++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 6cd5b47b77..78ecbea3c0 100644 --- a/Gemfile +++ b/Gemfile @@ -18,6 +18,8 @@ gem 'stateful_enum' # extends ActiveRecord::Enum with state gem 'webpacker' gem 'wisper' # publish subscribe for ruby objects +gem 's3_cache_store', github: 'tbhi/s3_cache_store', branch: 'fix-wrong-number-of-arguments' + # Database/Data gem 'after_party' # load data after deploy gem 'auto_strip_attributes', '~> 2.5' diff --git a/Gemfile.lock b/Gemfile.lock index 799b6869b4..c5b20e3b58 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -47,6 +47,15 @@ GIT rubyvis (~> 0.6.1) spreadsheet (~> 1.1) +GIT + remote: https://github.com/tbhi/s3_cache_store.git + revision: aac2733bee5f9ba4a5a2826f712d6844e0de5a95 + branch: fix-wrong-number-of-arguments + specs: + s3_cache_store (0.1.0) + activesupport (>= 6) + aws-sdk-s3 (~> 1) + GEM remote: https://rubygems.org/ specs: @@ -797,6 +806,7 @@ DEPENDENCIES rubocop-performance rubocop-rails rubocop-rspec + s3_cache_store! sass-rails scout_apm selenium-webdriver diff --git a/config/environments/production.rb b/config/environments/production.rb index 30211f4075..c1af91d4a8 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -144,7 +144,8 @@ config.active_storage.service = :amazon # session cookie has configurable name so that live and test logins are separated config.session_store :cookie_store, key: ENV.fetch('SESSION_COOKIE_NAME') { '_energy-sparks_session' }, domain: '.energysparks.uk' - config.cache_store = :file_store, "#{root}/tmp/cache/rails_cache_store" + config.active_record.cache_versioning = false + config.cache_store = :s3_cache_store, { bucket: ENV['CACHE_BUCKET'] } # Default good job execution mode configuration for production # See https://github.com/bensheldon/good_job#configuration-options config.good_job.execution_mode = :external