remove the discard operation after validation failure

This commit is contained in:
DigitalSonic
2019-02-28 23:03:58 +08:00
parent c1e73f2fa9
commit 3dc254a6c3
2 changed files with 2 additions and 5 deletions
@@ -31,7 +31,7 @@ import java.sql.Connection;
public class RandomDataSourceRecoverThread implements Runnable {
private final static Log LOG = LogFactory.getLog(RandomDataSourceRecoverThread.class);
private RandomDataSourceSelector selector;
private int sleepSeconds = 60;
private int sleepSeconds = 120;
private int validationSleepSeconds = 0;
public RandomDataSourceRecoverThread(RandomDataSourceSelector selector) {
@@ -69,9 +69,6 @@ public class RandomDataSourceRecoverThread implements Runnable {
} catch(Exception e) {
LOG.warn("DataSource[" + dataSource.getName() + "] is still unavailable. Exception: "
+ e.getMessage());
if (connection != null) {
dataSource.discardConnection(connection);
}
} finally {
JdbcUtils.close(connection);
}
@@ -51,7 +51,7 @@ public class RandomDataSourceSelector implements DataSourceSelector {
private RandomDataSourceRecoverThread recoverThread;
private int checkingIntervalSeconds = 15;
private int recoveryIntervalSeconds = 60;
private int recoveryIntervalSeconds = 120;
private int validationSleepSeconds = 0;
private int blacklistThreshold = 3;