From c0fdbed83fb8c6b5cf004af2fc9dd40e6bd595b4 Mon Sep 17 00:00:00 2001 From: milk1000cc Date: Sun, 31 Dec 2023 23:03:49 +0900 Subject: [PATCH] fix: ensure the engine is idle even when multiple requests are scheduled at once (#31) --- lib/vessel/engine.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vessel/engine.rb b/lib/vessel/engine.rb index 71505e0..cd37fe7 100644 --- a/lib/vessel/engine.rb +++ b/lib/vessel/engine.rb @@ -93,7 +93,7 @@ def idle? end def schedule(*requests) - requests.size.times { increase(:req_enqueued) } + requests.flatten.size.times { increase(:req_enqueued) } scheduler.post(*requests) end