File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/main/java/com/github/brainlag/nsq Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ public NSQConsumer start() {
7171 //connect once otherwise we might have to wait one lookupPeriod
7272 connect ();
7373 scheduler .scheduleAtFixedRate (() -> {
74- connect ();
74+ connect ();
7575 }, lookupPeriod , lookupPeriod , TimeUnit .MILLISECONDS );
7676 }
7777 return this ;
@@ -88,6 +88,7 @@ private Connection createConnection(final ServerAddress serverAddress) {
8888
8989 return connection ;
9090 } catch (final NoConnectionsException e ) {
91+ LogManager .getLogger (this ).warn ("Could not create connection to server {}" , serverAddress .toString (), e );
9192 return null ;
9293 }
9394 }
@@ -205,7 +206,10 @@ private void connect() {
205206
206207 for (final ServerAddress server : Sets .difference (newAddresses , oldAddresses )) {
207208 if (!connections .containsKey (server )) {
208- connections .put (server , createConnection (server ));
209+ final Connection connection = createConnection (server );
210+ if (connection != null ) {
211+ connections .put (server , connection );
212+ }
209213 }
210214 }
211215 }
You can’t perform that action at this time.
0 commit comments