2018-06-27 03:23:28 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-10-11 08:25:17 -04:00
|
|
|
class AuthorizedProjectsWorker
|
2017-11-28 11:08:30 -05:00
|
|
|
include ApplicationWorker
|
2018-02-26 06:17:50 -05:00
|
|
|
prepend WaitableWorker
|
2016-10-11 08:25:17 -04:00
|
|
|
|
2019-10-18 07:11:44 -04:00
|
|
|
feature_category :authentication_and_authorization
|
2019-10-30 11:14:17 -04:00
|
|
|
latency_sensitive_worker!
|
2019-10-18 07:11:44 -04:00
|
|
|
|
2018-04-09 09:46:33 -04:00
|
|
|
# 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
|
|
|
|
|
2018-08-27 11:31:01 -04:00
|
|
|
# rubocop: disable CodeReuse/ActiveRecord
|
2018-02-26 06:17:50 -05:00
|
|
|
def perform(user_id)
|
2016-10-11 08:25:17 -04:00
|
|
|
user = User.find_by(id: user_id)
|
|
|
|
|
2017-02-07 09:16:46 -05:00
|
|
|
user&.refresh_authorized_projects
|
2016-10-11 08:25:17 -04:00
|
|
|
end
|
2018-08-27 11:31:01 -04:00
|
|
|
# rubocop: enable CodeReuse/ActiveRecord
|
2016-10-11 08:25:17 -04:00
|
|
|
end
|