debian-mirror-gitlab/app/services/user_project_access_changed_service.rb

16 lines
352 B
Ruby
Raw Normal View History

2017-08-17 22:00:37 +05:30
class UserProjectAccessChangedService
def initialize(user_ids)
@user_ids = Array.wrap(user_ids)
end
2018-03-17 18:26:18 +05:30
def execute(blocking: true)
bulk_args = @user_ids.map { |id| [id] }
if blocking
AuthorizedProjectsWorker.bulk_perform_and_wait(bulk_args)
else
AuthorizedProjectsWorker.bulk_perform_async(bulk_args)
end
2017-08-17 22:00:37 +05:30
end
end