debian-mirror-gitlab/app/workers/concerns/waitable_worker.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
444 B
Ruby
Raw Normal View History

2018-11-08 19:23:39 +05:30
# frozen_string_literal: true
2018-03-27 19:54:05 +05:30
module WaitableWorker
extend ActiveSupport::Concern
2018-11-20 20:47:30 +05:30
class_methods do
2018-03-27 19:54:05 +05:30
# Schedules multiple jobs and waits for them to be completed.
2022-08-13 15:12:31 +05:30
def bulk_perform_and_wait(args_list)
bulk_perform_async(args_list)
2018-03-27 19:54:05 +05:30
end
end
def perform(*args)
notify_key = args.pop if Gitlab::JobWaiter.key?(args.last)
super(*args)
ensure
Gitlab::JobWaiter.notify(notify_key, jid) if notify_key
end
end