Skip to content

Commit

Permalink
chore: add retries to openssl errors in reading (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
ganchdev authored Oct 25, 2023
1 parent 46f1dfc commit 631a16b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/deploy_agent/agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
module DeployAgent
class Agent
def initialize(options = {})
@retries = 0
@options = options
end

Expand All @@ -24,6 +25,16 @@ def run
monitor.value.tx_data if monitor.writeable?
end
timers.fire

@retries = 0
end
rescue OpenSSL::SSL::SSLError => e
@retries += 1

if @retries == 4
raise e
else
retry
end
rescue ServerConnection::ServerDisconnected
retry
Expand Down

0 comments on commit 631a16b

Please # to comment.