Skip to content

Commit

Permalink
ClusterRequest should always return the same connection.
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin Duda committed Apr 29, 2018
1 parent e9eca90 commit 992930e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'maven'

project.version = "1.0.32-SNAPSHOT"
project.version = "1.0.33-SNAPSHOT"
project.group = 'com.github.codingchili.chili-core'

subprojects {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,12 @@ public void write(Object msg) {

@Override
public Connection connection() {
return new Connection((message) -> {
throw new UnsupportedOperationException("Cannot write to the connection of Cluster requests, use #write instead.");
}, "");
if (connection == null) {
connection = new Connection((message) -> {
throw new UnsupportedOperationException("Cannot write to the connection of Cluster requests, use #write instead.");
}, "");
}
return connection;
}

@Override
Expand Down

0 comments on commit 992930e

Please sign in to comment.