Skip to content
This repository has been archived by the owner on Jan 4, 2021. It is now read-only.

Commit

Permalink
(#523) handle MCollective::ClientTimeoutError
Browse files Browse the repository at this point in the history
The default behaviour of perpetually retrying connections is not
suitable for clients, especially ones run as part of some automation as
they might never exit

This respects the connection_timeout configuration option
  • Loading branch information
ripienaar committed Jul 26, 2018
1 parent ac63233 commit 359812c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/mcollective/util/natswrapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ def start(options={})

begin
@client.connect(options)

rescue ClientTimeoutError
raise

rescue
Log.error("Error during initial NATS setup: %s: %s" % [$!.class, $!.message])
Log.debug($!.backtrace.join("\n\t"))
Expand Down

0 comments on commit 359812c

Please sign in to comment.