2021-12-10 10:10:24 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Gitlab
|
|
|
|
module RepositoryArchiveRateLimiter
|
|
|
|
def check_archive_rate_limit!(current_user, project, &block)
|
2022-05-06 11:09:03 -04:00
|
|
|
return unless Feature.enabled?(:archive_rate_limit)
|
2021-12-10 10:10:24 -05:00
|
|
|
|
|
|
|
threshold = current_user ? nil : 100
|
|
|
|
|
|
|
|
check_rate_limit!(:project_repositories_archive, scope: [project, current_user], threshold: threshold, &block)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|