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.
This commit is contained in:
David Taylor 2020-12-17 00:02:41 +00:00 committed by GitHub
parent 9870a0b6a1
commit c54217f33d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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