Commit 33536df9 authored by Kerri Miller's avatar Kerri Miller

Update comment on #write_if_empty

parent 50dd9513
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment