gitlab-org--gitlab-foss/app/workers/authorized_projects_worker.rb
Yorick Peterse 2039c8280d
Disable existing offenses for the CodeReuse cops
This whitelists all existing offenses for the various CodeReuse cops, of
which most are triggered by the CodeReuse/ActiveRecord cop.
2018-09-11 17:32:00 +02:00

22 lines
597 B
Ruby

# frozen_string_literal: true
class AuthorizedProjectsWorker
include ApplicationWorker
prepend WaitableWorker
# 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
end
# rubocop: disable CodeReuse/ActiveRecord
def perform(user_id)
user = User.find_by(id: user_id)
user&.refresh_authorized_projects
end
# rubocop: enable CodeReuse/ActiveRecord
end