mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
Merge pull request #4516 from xenoamess-fork/int_overflow
bug: int overflow.
This commit is contained in:
+2
-2
@@ -83,7 +83,7 @@ public class RandomDataSourceRecoverThread implements Runnable {
|
||||
if (validationSleepSeconds > 0) {
|
||||
try {
|
||||
LOG.debug("Sleep " + validationSleepSeconds + " second(s) before validation.");
|
||||
Thread.sleep(validationSleepSeconds * 1000);
|
||||
Thread.sleep(validationSleepSeconds * 1000L);
|
||||
} catch (InterruptedException e) {
|
||||
// ignore
|
||||
}
|
||||
@@ -92,7 +92,7 @@ public class RandomDataSourceRecoverThread implements Runnable {
|
||||
|
||||
private void sleep() {
|
||||
try {
|
||||
Thread.sleep(recoverIntervalSeconds * 1000);
|
||||
Thread.sleep(recoverIntervalSeconds * 1000L);
|
||||
} catch (InterruptedException e) {
|
||||
// ignore
|
||||
}
|
||||
|
||||
+3
-3
@@ -100,7 +100,7 @@ public class RandomDataSourceValidateThread implements Runnable {
|
||||
try {
|
||||
LOG.debug("[RandomDataSourceValidateThread@" + hashCode() + "] Sleep " + newSleepSeconds
|
||||
+ " second(s) until next checking.");
|
||||
Thread.sleep(newSleepSeconds * 1000);
|
||||
Thread.sleep(newSleepSeconds * 1000L);
|
||||
} catch (InterruptedException e) {
|
||||
// ignore
|
||||
}
|
||||
@@ -213,8 +213,8 @@ public class RandomDataSourceValidateThread implements Runnable {
|
||||
LOG.debug("DataSource=" + name + ", lastSuccessTime=" + lastSuccessTime
|
||||
+ ", lastCheckTime=" + lastCheckTime + ", currentTime=" + currentTime);
|
||||
return lastSuccessTime != null && lastCheckTime != null
|
||||
&& (currentTime - lastSuccessTime) <= checkingIntervalSeconds * 1000
|
||||
&& (currentTime - lastCheckTime) <= 5 * checkingIntervalSeconds * 1000
|
||||
&& (currentTime - lastSuccessTime) <= checkingIntervalSeconds * 1000L
|
||||
&& (currentTime - lastCheckTime) <= checkingIntervalSeconds * 1000L * 5
|
||||
&& (!errorCounts.containsKey(name) || errorCounts.get(name) < 1);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -78,7 +78,7 @@ public class StickyRandomDataSourceSelector extends RandomDataSourceSelector {
|
||||
}
|
||||
|
||||
private boolean isExpired(StickyDataSourceHolder holder) {
|
||||
return System.currentTimeMillis() - holder.getRetrievingTime() > expireSeconds * 1000;
|
||||
return System.currentTimeMillis() - holder.getRetrievingTime() > expireSeconds * 1000L;
|
||||
}
|
||||
|
||||
public int getExpireSeconds() {
|
||||
|
||||
Reference in New Issue
Block a user