2018-06-27 03:23:28 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-03-13 08:09:22 -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
|
2020-03-02 13:07:42 -05:00
|
|
|
urgency :high
|
2020-01-24 13:09:00 -05:00
|
|
|
weight 2
|
2020-03-13 08:09:22 -04:00
|
|
|
idempotent!
|
2020-06-16 11:08:32 -04:00
|
|
|
loggable_arguments 1 # For the job waiter key
|
2020-03-13 08:09:22 -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
|
2020-08-05 17:09:40 -04:00
|
|
|
|
|
|
|
def self.bulk_perform_inline(args_list)
|
|
|
|
end
|
2018-04-09 09:46:33 -04:00
|
|
|
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
|