Commit 56af2dbe authored by Douwe Maan's avatar Douwe Maan

Allow bulk_perform_and_wait wait timeout to be overridden

parent 1751cab4
...@@ -3,7 +3,7 @@ module WaitableWorker ...@@ -3,7 +3,7 @@ module WaitableWorker
module ClassMethods module ClassMethods
# Schedules multiple jobs and waits for them to be completed. # Schedules multiple jobs and waits for them to be completed.
def bulk_perform_and_wait(args_list) def bulk_perform_and_wait(args_list, timeout: 10)
# Short-circuit: it's more efficient to do small numbers of jobs inline # Short-circuit: it's more efficient to do small numbers of jobs inline
return bulk_perform_inline(args_list) if args_list.size <= 3 return bulk_perform_inline(args_list) if args_list.size <= 3
...@@ -14,7 +14,7 @@ module WaitableWorker ...@@ -14,7 +14,7 @@ module WaitableWorker
waiting_args_list = args_list.map { |args| [*args, waiter.key] } waiting_args_list = args_list.map { |args| [*args, waiter.key] }
bulk_perform_async(waiting_args_list) bulk_perform_async(waiting_args_list)
waiter.wait waiter.wait(timeout)
end end
# Performs multiple jobs directly. Failed jobs will be put into sidekiq so # Performs multiple jobs directly. Failed jobs will be put into sidekiq so
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment