mirror of
https://github.com/discourse/discourse.git
synced 2025-09-04 08:47:37 +08:00
DEV: Key the Theme DistributedCache
on BASE_COMPILER_VERSION
(#17495)
All `DistributedCache` instances in Discourse are automatically keyed on the `Discourse.git_version`. Normally the theme compiler version is updated via a commit, and everything is fine. However, in some situations, it's possible for the BASE_COMPILER_VERSION to change without a change to the git_version (e.g. when applying patches directly to the codebase). This commit adds the `BASE_COMPILER_VERSION` to the DistributedCache key to ensure that content from different compiler versions does not leak into other processes.
This commit is contained in:
parent
d52d479bd4
commit
92e8a6d62b
1 changed files with 3 additions and 2 deletions
|
@ -6,9 +6,11 @@ require 'json_schemer'
|
|||
class Theme < ActiveRecord::Base
|
||||
include GlobalPath
|
||||
|
||||
BASE_COMPILER_VERSION = 56
|
||||
|
||||
attr_accessor :child_components
|
||||
|
||||
@cache = DistributedCache.new('theme')
|
||||
@cache = DistributedCache.new("theme:compiler#{BASE_COMPILER_VERSION}")
|
||||
|
||||
belongs_to :user
|
||||
belongs_to :color_scheme
|
||||
|
@ -154,7 +156,6 @@ class Theme < ActiveRecord::Base
|
|||
SvgSprite.expire_cache
|
||||
end
|
||||
|
||||
BASE_COMPILER_VERSION = 56
|
||||
def self.compiler_version
|
||||
get_set_cache "compiler_version" do
|
||||
dependencies = [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue