Skip to content

Commit

Permalink
Handles GRPC::NotFound exceptions
Browse files Browse the repository at this point in the history
Also adds support for reporting the number of connections attempts have been made.
  • Loading branch information
mscottford committed Sep 1, 2023
1 parent dd539e6 commit 1c6d997
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/corgibytes/freshli/commons/grpc_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,15 @@ def is_running!
# rubocop:disable Metrics/MethodLength
def wait_until_running!
Timeout.timeout(5) do
attempts = 0
loop do
attempts += 1
yield(attempts) if block_given?

status = nil
begin
status = health_check
rescue GRPC::Unavailable
rescue GRPC::Unavailable, GRPC::NotFound
status = nil
end

Expand Down

0 comments on commit 1c6d997

Please sign in to comment.