From c54217f33d3703b55711ec69dd60a5e3385e3eb5 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Thu, 17 Dec 2020 00:02:41 +0000 Subject: [PATCH] FIX: Clear in-process theme cache after clearing DB cache (#11517) If we clear the in-process cache first, it might get re-filled from the DB before we clear the DB cache. This would be more likely on high-traffic sites. --- app/models/theme_translation_override.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/theme_translation_override.rb b/app/models/theme_translation_override.rb index 93ba1f2bca9..ec639c2731f 100644 --- a/app/models/theme_translation_override.rb +++ b/app/models/theme_translation_override.rb @@ -4,9 +4,9 @@ class ThemeTranslationOverride < ActiveRecord::Base belongs_to :theme after_commit do + theme.theme_fields.where(target_id: Theme.targets[:translations]).update_all(value_baked: nil) theme.clear_cached_settings! theme.remove_from_cache! - theme.theme_fields.where(target_id: Theme.targets[:translations]).update_all(value_baked: nil) end end