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>2020-03-26 12:07:52 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-26 12:07:52 +0300
commit7e019504f5ac6decde690565857238e7e59aa034 (patch)
treefab8832b40e25fc9bc1ae54b9303b95ea146b5d5 /app/workers
parent116d4e56e83a1f408afe710ce070e699ba206475 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/all_queues.yml7
-rw-r--r--app/workers/update_highest_role_worker.rb19
2 files changed, 26 insertions, 0 deletions
diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml
index 72a5a2b653e..16520519a0b 100644
--- a/app/workers/all_queues.yml
+++ b/app/workers/all_queues.yml
@@ -1333,6 +1333,13 @@
:resource_boundary: :unknown
:weight: 3
:idempotent:
+- :name: update_highest_role
+ :feature_category: :authentication_and_authorization
+ :has_external_dependencies:
+ :urgency: :high
+ :resource_boundary: :unknown
+ :weight: 2
+ :idempotent: true
- :name: update_merge_requests
:feature_category: :source_code_management
:has_external_dependencies:
diff --git a/app/workers/update_highest_role_worker.rb b/app/workers/update_highest_role_worker.rb
new file mode 100644
index 00000000000..e62131a77d0
--- /dev/null
+++ b/app/workers/update_highest_role_worker.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class UpdateHighestRoleWorker
+ include ApplicationWorker
+
+ feature_category :authentication_and_authorization
+ urgency :high
+ weight 2
+
+ idempotent!
+
+ # rubocop: disable CodeReuse/ActiveRecord
+ def perform(user_id)
+ user = User.active.find_by(id: user_id)
+
+ Users::UpdateHighestMemberRoleService.new(user).execute if user.present?
+ end
+ # rubocop: enable CodeReuse/ActiveRecord
+end