Skip to content

Commit 6a21672

Browse files
committed
Improve DruidDataSourcePoolMetadata
1 parent 8215e94 commit 6a21672

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Diff for: spring-boot-starters-extend/druid-actuator-spring-boot-starter/src/main/java/com/spring/boot/jdbc/metadata/DruidDataSourcePoolMetadata.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ public Integer getActive() {
3636

3737
@Override
3838
public Integer getIdle() {
39-
// try {
40-
// return (int) getDataSource().getConnectCount();
41-
// }
42-
// catch (Exception ex) {
43-
// return null;
44-
// }
45-
return (int) getDataSource().getDataSourceStat().getConnectionStat().getConnectCount();
39+
try {
40+
return (int) getDataSource().getConnectCount();
41+
}
42+
catch (Exception ex) {
43+
return null;
44+
}
45+
// return (int) getDataSource().getDataSourceStat().getConnectionStat().getConnectCount();
4646
}
4747

4848
private int getEvictCount() {

0 commit comments

Comments
 (0)