Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
33536df9
Commit
33536df9
authored
Nov 26, 2019
by
Kerri Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update comment on #write_if_empty
parent
50dd9513
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
lib/gitlab/diff/highlight_cache.rb
lib/gitlab/diff/highlight_cache.rb
+6
-0
No files found.
lib/gitlab/diff/highlight_cache.rb
View file @
33536df9
...
...
@@ -15,6 +15,7 @@ module Gitlab
# - Reads from cache
# - Assigns DiffFile#highlighted_diff_lines for cached files
#
def
decorate
(
diff_file
)
if
content
=
read_file
(
diff_file
)
diff_file
.
highlighted_diff_lines
=
content
.
map
do
|
line
|
...
...
@@ -23,6 +24,11 @@ module Gitlab
end
end
# For every file that isn't already contained in the redis hash, store the
# result of #highlighted_diff_lines, then submit the uncached content
# to #write_to_redis_hash to submit a single write. This avoids excessive
# IO generated by N+1's (1 writing for each highlighted line or file).
#
def
write_if_empty
diff_files
=
@diff_collection
.
diff_files
cached_diff_files
=
read_cache
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment