From eacc06ab2f40ed40eb9fe3a07664737dc4274706 Mon Sep 17 00:00:00 2001 From: Christian Bruckmayer Date: Mon, 29 Apr 2024 09:25:47 +0100 Subject: [PATCH] Return true if queue is initialized --- ruby/lib/ci/queue/redis/base.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ruby/lib/ci/queue/redis/base.rb b/ruby/lib/ci/queue/redis/base.rb index 6b4ec153..d5c4ad1a 100644 --- a/ruby/lib/ci/queue/redis/base.rb +++ b/ruby/lib/ci/queue/redis/base.rb @@ -139,6 +139,8 @@ def progress def wait_for_master(timeout: 30) return true if master? + return true if queue_initialized? + (timeout * 10 + 1).to_i.times do if queue_initialized? return true @@ -146,6 +148,7 @@ def wait_for_master(timeout: 30) sleep 0.1 end end + raise LostMaster, "The master worker is still `#{master_status}` after #{timeout} seconds waiting." end