From 69dc397e8dacf6cc40ebfa7747a50cbb027f2f97 Mon Sep 17 00:00:00 2001 From: Andrey Novikov Date: Mon, 19 Jun 2023 23:00:00 +0900 Subject: [PATCH] Fix lazy connection after code reload in Rails --- lib/nats/io/client.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nats/io/client.rb b/lib/nats/io/client.rb index 6327512..a5b5f0c 100644 --- a/lib/nats/io/client.rb +++ b/lib/nats/io/client.rb @@ -1078,7 +1078,7 @@ def single_url_connect_used? def send_command(command) raise NATS::IO::ConnectionClosedError if closed? - establish_connection! unless status + establish_connection! if !status || (disconnected? && should_reconnect?) @pending_size += command.bytesize @pending_queue << command