Commit c412e58a authored by Corinna Wiesner's avatar Corinna Wiesner

Fix loading of EE::Gitlab::RepositorySizeChecker

The EE class for Gitlab::RepositorySizeChecker wasn't correctly loaded.
This change will fix this issue by moving it to the correct path and
adding the prepend to the original class.
parent 9d2a9f8a
# frozen_string_literal: true
module EE
module Gitlab
module RepositorySizeChecker
extend ActiveSupport::Concern
extend ::Gitlab::Utils::Override
override :above_size_limit?
def above_size_limit?
return false unless enabled?
return false if additional_repo_storage_available? && total_repository_size_excess <= additional_purchased_storage
super
end
override :exceeded_size
# @param change_size [int] in bytes
def exceeded_size(change_size = 0)
exceeded_size = super
exceeded_size -= remaining_additional_purchased_storage if additional_repo_storage_available?
exceeded_size
end
private
def additional_repo_storage_available?
return false unless ::Gitlab::CurrentSettings.automatic_purchased_storage_allocation?
::Feature.enabled?(:additional_repo_storage_by_namespace)
end
def remaining_additional_purchased_storage
additional_purchased_storage - total_repository_size_excess
end
end
end
end
# frozen_string_literal: true
module Gitlab
module RepositorySizeChecker
extend ActiveSupport::Concern
extend ::Gitlab::Utils::Override
override :above_size_limit?
def above_size_limit?
return false unless enabled?
return false if additional_repo_storage_available? && total_repository_size_excess <= additional_purchased_storage
super
end
override :exceeded_size
# @param change_size [int] in bytes
def exceeded_size(change_size = 0)
exceeded_size = super
exceeded_size -= remaining_additional_purchased_storage if additional_repo_storage_available?
exceeded_size
end
private
def additional_repo_storage_available?
return false unless Gitlab::CurrentSettings.automatic_purchased_storage_allocation?
Feature.enabled?(:additional_repo_storage_by_namespace)
end
def remaining_additional_purchased_storage
additional_purchased_storage - total_repository_size_excess
end
end
end
......@@ -42,7 +42,9 @@ module Gitlab
end
def error_message
@error_message_object ||= Gitlab::RepositorySizeErrorMessage.new(self)
@error_message_object ||= ::Gitlab::RepositorySizeErrorMessage.new(self)
end
end
end
Gitlab::RepositorySizeChecker.prepend_if_ee('EE::Gitlab::RepositorySizeChecker')
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