Add a gurad logic not to hit chunk_store if unnecessary

This commit is contained in:
Shinya Maeda 2018-04-03 15:35:21 +09:00
parent f0ddad75e9
commit 098fbac199
1 changed files with 4 additions and 0 deletions

View File

@ -102,6 +102,8 @@ module Gitlab
until eof?
data = get_chunk
break if data.empty?
new_line = data.index("\n")
if !new_line.nil?
@ -150,6 +152,8 @@ module Gitlab
end
def get_chunk
return '' unless size > 0
unless in_range?
chunk_store.open(job_id, chunk_index, params_for_store) do |store|
@chunk = store.get