diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-09 15:07:58 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-09 15:07:58 +0300 |
commit | 93c6764dacd4c605027ef1cd367d3aebe420b223 (patch) | |
tree | 5213b1fc874ee3e31701a81007f97d7664b95205 /lib/gitlab/diff | |
parent | aa10b541b6a3fbc7fa712abcc59d073fc8dc620a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/diff')
-rw-r--r-- | lib/gitlab/diff/highlight_cache.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/gitlab/diff/highlight_cache.rb b/lib/gitlab/diff/highlight_cache.rb index 12a1db70b36..3d511b9a5b2 100644 --- a/lib/gitlab/diff/highlight_cache.rb +++ b/lib/gitlab/diff/highlight_cache.rb @@ -54,6 +54,15 @@ module Gitlab private + # We create a Gitlab::Diff::DeprecatedHighlightCache here in order to + # expire deprecated cache entries while we make the transition. This can + # be removed when :hset_redis_diff_caching is fully launched. + # See https://gitlab.com/gitlab-org/gitlab/issues/38008 + # + def deprecated_cache + @deprecated_cache ||= Gitlab::Diff::DeprecatedHighlightCache.new(@diff_collection) + end + def uncached_files diff_files = @diff_collection.diff_files @@ -85,6 +94,10 @@ module Gitlab redis.expire(key, EXPIRATION) end end + + # Clean up any deprecated hash entries + # + deprecated_cache.clear end def file_paths |