Skip to content

Commit

Permalink
Improve worker_pool worker utilization
Browse files Browse the repository at this point in the history
Make use of the new dispatch_sync function in
rabbitmq/rabbitmq-common#368 to block only when all
workers are busy

(cherry picked from commit 01270fd)
  • Loading branch information
HoloRin authored and dumbbell committed May 13, 2020
1 parent 78a09ca commit 7127195
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rabbit_msg_store.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1801,7 +1801,7 @@ build_index_worker(Gatherer, State = #msstate { dir = Dir },
enqueue_build_index_workers(Gatherer, Left, [], State) ->
exit(normal);
enqueue_build_index_workers(Gatherer, Left, [File|Files], State) ->
ok = worker_pool:submit(
ok = worker_pool:dispatch_sync(
fun () ->
link(Gatherer),
ok = build_index_worker(Gatherer, State,
Expand Down

0 comments on commit 7127195

Please sign in to comment.