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

authorized_projects_worker.rb « workers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: afe14369d4308be005d913c1a070364ba1f517aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# frozen_string_literal: true

class AuthorizedProjectsWorker
  include ApplicationWorker

  data_consistency :always

  sidekiq_options retry: 3
  prepend WaitableWorker

  feature_category :authentication_and_authorization
  urgency :high
  weight 2
  idempotent!
  loggable_arguments 1 # For the job waiter key

  # This is a workaround for a Ruby 2.3.7 bug. rspec-mocks cannot restore the
  # visibility of prepended modules. See https://github.com/rspec/rspec-mocks/issues/1231
  # for more details.
  if Rails.env.test?
    def self.bulk_perform_and_wait(args_list, timeout: 10)
    end

    def self.bulk_perform_inline(args_list)
    end
  end

  def perform(user_id)
    user = User.find_by_id(user_id)

    user&.refresh_authorized_projects(source: self.class.name)
  end
end