diff options
author | Stan Hu <stanhu@gmail.com> | 2018-04-05 12:52:20 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-04-05 12:55:12 -0700 |
commit | d209a05486503f1dd6412c777c1fd29fe02f0a40 (patch) | |
tree | 7a8b55d3cba1348ee78b78df069cdea2eebf14d0 | |
parent | eaed588bf228c833cb666a61bc7d25cf21d5f94b (diff) | |
download | gitlab-ce-d209a05486503f1dd6412c777c1fd29fe02f0a40.tar.gz |
Use the GitLab version as part of the appearances cache keysh-appearance-cache-key-version
This prevents us from having to manually flush the cache key
in migrations every time a new column is added.
Closes https://gitlab.com/gitlab-org/gitlab-ee/issues/5571
-rw-r--r-- | app/models/appearance.rb | 2 | ||||
-rw-r--r-- | changelogs/unreleased/sh-appearance-cache-key-version.yml | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/app/models/appearance.rb b/app/models/appearance.rb index 2a6406d63c7..fb66dd0b766 100644 --- a/app/models/appearance.rb +++ b/app/models/appearance.rb @@ -16,7 +16,7 @@ class Appearance < ActiveRecord::Base has_many :uploads, as: :model, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent - CACHE_KEY = 'current_appearance'.freeze + CACHE_KEY = "current_appearance:#{Gitlab::VERSION}".freeze after_commit :flush_redis_cache diff --git a/changelogs/unreleased/sh-appearance-cache-key-version.yml b/changelogs/unreleased/sh-appearance-cache-key-version.yml new file mode 100644 index 00000000000..c17a3dc36cd --- /dev/null +++ b/changelogs/unreleased/sh-appearance-cache-key-version.yml @@ -0,0 +1,5 @@ +--- +title: Use the GitLab version as part of the appearances cache key +merge_request: +author: +type: fixed |