Skip to content

Commit

Permalink
Merge pull request #1918 from xetorthio/gkorland-dataSource-reset
Browse files Browse the repository at this point in the history
Move dataSource reset before connection returned
  • Loading branch information
gkorland committed Dec 18, 2018
2 parents 95aa6a9 + df1bffa commit 1e536e8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/java/redis/clients/jedis/Jedis.java
Original file line number Diff line number Diff line change
Expand Up @@ -3452,12 +3452,13 @@ public Map<String, String> pubsubNumSub(String... channels) {
@Override
public void close() {
if (dataSource != null) {
JedisPoolAbstract pool = this.dataSource;
this.dataSource = null;
if (client.isBroken()) {
this.dataSource.returnBrokenResource(this);
pool.returnBrokenResource(this);
} else {
this.dataSource.returnResource(this);
pool.returnResource(this);
}
this.dataSource = null;
} else {
super.close();
}
Expand Down

0 comments on commit 1e536e8

Please sign in to comment.