diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-23 03:09:07 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-23 03:09:07 +0000 |
commit | d5f3ebc322dec22bf58d366fd91037c69add3fc0 (patch) | |
tree | 40da39f5e1cb3fa7a17b7364767d60ff4dfa73d8 | |
parent | 9c71f76e2b49c070c35cb209fe3729e01a7ce92c (diff) | |
download | gitlab-ce-d5f3ebc322dec22bf58d366fd91037c69add3fc0.tar.gz |
Add latest changes from gitlab-org/gitlab@master
-rw-r--r-- | lib/gitlab/rate_limit_helpers.rb | 2 | ||||
-rw-r--r-- | spec/lib/gitlab/rate_limit_helpers_spec.rb | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/gitlab/rate_limit_helpers.rb b/lib/gitlab/rate_limit_helpers.rb index a7cab650968..2dcc888892b 100644 --- a/lib/gitlab/rate_limit_helpers.rb +++ b/lib/gitlab/rate_limit_helpers.rb @@ -11,7 +11,7 @@ module Gitlab key = ARCHIVE_RATE_THROTTLE_KEY - if rate_limiter.throttled?(key, scope: [project], threshold: archive_rate_threshold_by_user(user)) + if rate_limiter.throttled?(key, scope: [project, user], threshold: archive_rate_threshold_by_user(user)) rate_limiter.log_request(request, "#{key}_request_limit".to_sym, user) return true diff --git a/spec/lib/gitlab/rate_limit_helpers_spec.rb b/spec/lib/gitlab/rate_limit_helpers_spec.rb index 7eee30d60ca..5ab79a2bbfe 100644 --- a/spec/lib/gitlab/rate_limit_helpers_spec.rb +++ b/spec/lib/gitlab/rate_limit_helpers_spec.rb @@ -43,6 +43,7 @@ describe Gitlab::RateLimitHelpers, :clean_gitlab_redis_shared_state do end expect(class_instance.archive_rate_limit_reached?(nil, project)).to be_truthy + expect(class_instance.archive_rate_limit_reached?(user, project)).to be_falsey end end end |