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
|
2021-04-30 14:10:09 -04:00
|
|
|
|
2021-07-21 08:09:35 -04:00
|
|
|
data_consistency :always
|
|
|
|
|
2021-04-30 14:10:09 -04:00
|
|
|
sidekiq_options retry: 3
|
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-02-26 06:17:50 -05:00
|
|
|
def perform(user_id)
|
2021-11-10 10:13:21 -05:00
|
|
|
user = User.find_by_id(user_id)
|
2016-10-11 08:25:17 -04:00
|
|
|
|
2021-02-04 13:09:22 -05:00
|
|
|
user&.refresh_authorized_projects(source: self.class.name)
|
2016-10-11 08:25:17 -04:00
|
|
|
end
|
|
|
|
end
|