Refactor max_size method in update pages service

As per review feedback
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/13072#note_35853177
This commit is contained in:
Grzegorz Bizon 2017-07-26 11:19:57 +02:00
parent 7151fb754b
commit cb405aa45d
1 changed files with 5 additions and 3 deletions

View File

@ -130,9 +130,11 @@ module Projects
end
def max_size
current_application_settings.max_pages_size.megabytes.tap do |maximum|
return MAX_SIZE if maximum.zero? || maximum > MAX_SIZE
end
max_pages_size = current_application_settings.max_pages_size.megabytes
return MAX_SIZE if max_pages_size.zero?
[max_pages_size, MAX_SIZE].min
end
def tmp_path