Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-06-07 15:08:05 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-06-07 15:08:05 +0300
commitedb317e9fe43c62229805fae529c550467ee5dc5 (patch)
tree90c590ea021e657b828685ac4459713913928dc9 /app/services/user_project_access_changed_service.rb
parentbdd03bc52aee1c3f37e25ae9b1fc8a27885b7428 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/user_project_access_changed_service.rb')
-rw-r--r--app/services/user_project_access_changed_service.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/services/user_project_access_changed_service.rb b/app/services/user_project_access_changed_service.rb
index 033006fc57b..ceaf21bb926 100644
--- a/app/services/user_project_access_changed_service.rb
+++ b/app/services/user_project_access_changed_service.rb
@@ -2,8 +2,10 @@
class UserProjectAccessChangedService
DELAY = 1.hour
+ MEDIUM_DELAY = 10.minutes
HIGH_PRIORITY = :high
+ MEDIUM_PRIORITY = :medium
LOW_PRIORITY = :low
def initialize(user_ids)
@@ -21,6 +23,8 @@ class UserProjectAccessChangedService
else
if priority == HIGH_PRIORITY
AuthorizedProjectsWorker.bulk_perform_async(bulk_args) # rubocop:disable Scalability/BulkPerformWithContext
+ elsif priority == MEDIUM_PRIORITY
+ AuthorizedProjectUpdate::UserRefreshWithLowUrgencyWorker.bulk_perform_in(MEDIUM_DELAY, bulk_args, batch_size: 100, batch_delay: 30.seconds) # rubocop:disable Scalability/BulkPerformWithContext
else
with_related_class_context do
# We wrap the execution in `with_related_class_context`so as to obtain