2018-06-27 07:23:28 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-03-13 12:09:22 +00:00
|
|
|
class AuthorizedProjectsWorker
|
2017-11-28 16:08:30 +00:00
|
|
|
include ApplicationWorker
|
2021-04-30 18:10:09 +00:00
|
|
|
|
2021-07-21 12:09:35 +00:00
|
|
|
data_consistency :always
|
|
|
|
|
2021-04-30 18:10:09 +00:00
|
|
|
sidekiq_options retry: 3
|
2018-02-26 11:17:50 +00:00
|
|
|
prepend WaitableWorker
|
2016-10-11 12:25:17 +00:00
|
|
|
|
2019-10-18 11:11:44 +00:00
|
|
|
feature_category :authentication_and_authorization
|
2020-03-02 18:07:42 +00:00
|
|
|
urgency :high
|
2020-01-24 18:09:00 +00:00
|
|
|
weight 2
|
2020-03-13 12:09:22 +00:00
|
|
|
idempotent!
|
2020-06-16 15:08:32 +00:00
|
|
|
loggable_arguments 1 # For the job waiter key
|
2020-03-13 12:09:22 +00:00
|
|
|
|
2018-02-26 11:17:50 +00:00
|
|
|
def perform(user_id)
|
2021-11-10 15:13:21 +00:00
|
|
|
user = User.find_by_id(user_id)
|
2016-10-11 12:25:17 +00:00
|
|
|
|
2021-02-04 18:09:22 +00:00
|
|
|
user&.refresh_authorized_projects(source: self.class.name)
|
2016-10-11 12:25:17 +00:00
|
|
|
end
|
|
|
|
end
|