Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/diff/highlight_cache.rb')
-rw-r--r--lib/gitlab/diff/highlight_cache.rb18
1 files changed, 3 insertions, 15 deletions
diff --git a/lib/gitlab/diff/highlight_cache.rb b/lib/gitlab/diff/highlight_cache.rb
index 084ce63e36a..d6f5e45c034 100644
--- a/lib/gitlab/diff/highlight_cache.rb
+++ b/lib/gitlab/diff/highlight_cache.rb
@@ -82,16 +82,6 @@ module Gitlab
private
- def expiration
- return 1.day unless Feature.enabled?(:highlight_diffs_renewable_expiration, diffable.project)
-
- if Feature.enabled?(:highlight_diffs_short_renewable_expiration, diffable.project)
- EXPIRATION
- else
- 8.hours
- end
- end
-
def set_highlighted_diff_lines(diff_file, content)
diff_file.highlighted_diff_lines = content.map do |line|
Gitlab::Diff::Line.safe_init_from_hash(line)
@@ -147,7 +137,7 @@ module Gitlab
end
# HSETs have to have their expiration date manually updated
- pipeline.expire(key, expiration)
+ pipeline.expire(key, EXPIRATION)
end
record_memory_usage(fetch_memory_usage(redis, key))
@@ -197,14 +187,12 @@ module Gitlab
return {} unless file_paths.any?
results = []
- cache_key = key
- highlight_diffs_renewable_expiration_enabled = Feature.enabled?(:highlight_diffs_renewable_expiration, diffable.project)
- expiration_period = expiration
+ cache_key = key # Moving out redis calls for feature flags out of redis.pipelined
Gitlab::Redis::Cache.with do |redis|
redis.pipelined do |pipeline|
results = pipeline.hmget(cache_key, file_paths)
- pipeline.expire(key, expiration_period) if highlight_diffs_renewable_expiration_enabled
+ pipeline.expire(key, EXPIRATION)
end
end