From 03f0d389c4a5fb55b476f9e76bc0c77df714ea4c Mon Sep 17 00:00:00 2001 From: milk1000cc Date: Tue, 19 Dec 2023 10:40:04 +0900 Subject: [PATCH] fix: ensure the engine is idle even when multiple requests are scheduled at once --- 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