Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot
2020-09-02 03:10:30 +00:00
parent bd06cdbc91
commit e28b754d23
14 changed files with 184 additions and 55 deletions

View File

@ -3,6 +3,8 @@
module Gitlab
module DiscussionsDiff
class HighlightCache
extend Gitlab::Utils::Gzip
class << self
VERSION = 1
EXPIRATION = 1.week
@ -17,7 +19,7 @@ module Gitlab
mapping.each do |raw_key, value|
key = cache_key_for(raw_key)
multi.set(key, value.to_json, ex: EXPIRATION)
multi.set(key, gzip_compress(value.to_json), ex: EXPIRATION)
end
end
end
@ -44,7 +46,7 @@ module Gitlab
content.map! do |lines|
next unless lines
Gitlab::Json.parse(lines).map! do |line|
Gitlab::Json.parse(gzip_decompress(lines)).map! do |line|
Gitlab::Diff::Line.safe_init_from_hash(line)
end
end