From 2b0e13257798166d1c22168f6129fc65dc70f2ee Mon Sep 17 00:00:00 2001 From: Anna Headley <845363+hackartisan@users.noreply.github.com> Date: Wed, 11 Oct 2023 11:59:18 -0400 Subject: [PATCH] Do 8 concurrent tasks instead of 10 This splits the 22 sets of images up more evenly, and uses a bit fewer concurrent resources. Previous iteration overwhelmed the staging machine into a memory allocation crash. Resources have also been increased, and now there are 8 cores, so 8 seems good for that reason, too. --- app/services/card_image_loading_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/card_image_loading_service.rb b/app/services/card_image_loading_service.rb index 09de13f..f7dd2d8 100644 --- a/app/services/card_image_loading_service.rb +++ b/app/services/card_image_loading_service.rb @@ -17,7 +17,7 @@ def initialize(logger: nil, suppress_progress: false) def import barrier = Async::Barrier.new Sync do - semaphore = Async::Semaphore.new(10, parent: barrier) + semaphore = Async::Semaphore.new(8, parent: barrier) (1..22).map do |disk| semaphore.async do