Skip to content

Commit

Permalink
Merge pull request #274 from Shopify/cbruckmayer/check-master
Browse files Browse the repository at this point in the history
Return true if queue is initialized
  • Loading branch information
ChrisBr authored Apr 29, 2024
2 parents 2e2bf4f + eacc06a commit 2da7c87
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ruby/lib/ci/queue/redis/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,16 @@ 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
else
sleep 0.1
end
end

raise LostMaster, "The master worker is still `#{master_status}` after #{timeout} seconds waiting."
end

Expand Down

0 comments on commit 2da7c87

Please sign in to comment.