2018-07-05 10:18:17 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-10-11 12:25:17 +00:00
|
|
|
class UserProjectAccessChangedService
|
|
|
|
def initialize(user_ids)
|
|
|
|
@user_ids = Array.wrap(user_ids)
|
|
|
|
end
|
|
|
|
|
2017-08-23 14:28:16 +00:00
|
|
|
def execute(blocking: true)
|
|
|
|
bulk_args = @user_ids.map { |id| [id] }
|
|
|
|
|
|
|
|
if blocking
|
|
|
|
AuthorizedProjectsWorker.bulk_perform_and_wait(bulk_args)
|
|
|
|
else
|
2020-02-04 15:08:40 +00:00
|
|
|
AuthorizedProjectsWorker.bulk_perform_async(bulk_args) # rubocop:disable Scalability/BulkPerformWithContext
|
2017-08-23 14:28:16 +00:00
|
|
|
end
|
2016-10-11 12:25:17 +00:00
|
|
|
end
|
|
|
|
end
|
2019-09-13 13:26:31 +00:00
|
|
|
|
|
|
|
UserProjectAccessChangedService.prepend_if_ee('EE::UserProjectAccessChangedService')
|