diff --git a/app/controllers/concerns/cache_concern.rb b/app/controllers/concerns/cache_concern.rb index e606218acb69f..a5a9ba3e1fdd7 100644 --- a/app/controllers/concerns/cache_concern.rb +++ b/app/controllers/concerns/cache_concern.rb @@ -187,7 +187,7 @@ def cache_collection(raw, klass) return [] if raw.empty? cached_keys_with_value = begin - Rails.cache.read_multi(*raw, namespace: 'v2').transform_keys(&:id).transform_values { |r| ActiveRecordCoder.load(r) } + Rails.cache.read_multi(*raw).transform_keys(&:id).transform_values { |r| ActiveRecordCoder.load(r) } rescue ActiveRecordCoder::Error {} # The serialization format may have changed, let's pretend it's a cache miss. end @@ -200,7 +200,7 @@ def cache_collection(raw, klass) uncached = klass.where(id: uncached_ids).with_includes.index_by(&:id) uncached.each_value do |item| - Rails.cache.write(item, ActiveRecordCoder.dump(item), namespace: 'v2') + Rails.cache.write(item, ActiveRecordCoder.dump(item)) end end diff --git a/app/models/status.rb b/app/models/status.rb index 2e32c3f16b7ea..2757497db986d 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -140,6 +140,10 @@ class Status < ApplicationRecord REAL_TIME_WINDOW = 6.hours + def cache_key + "v2:#{super}" + end + def searchable_by(preloaded = nil) ids = []