This commit is contained in:
@@ -102,7 +102,7 @@ public abstract class PoolTcpSource extends PoolSource<AsyncConnection> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected CompletableFuture<AsyncConnection> pollAsync(final int count) {
|
protected CompletableFuture<AsyncConnection> pollAsync(final int count) {
|
||||||
if (count >= 3) {
|
if (count >= 5) {
|
||||||
logger.log(Level.WARNING, "create datasource connection error");
|
logger.log(Level.WARNING, "create datasource connection error");
|
||||||
CompletableFuture<AsyncConnection> future = new CompletableFuture<>();
|
CompletableFuture<AsyncConnection> future = new CompletableFuture<>();
|
||||||
future.completeExceptionally(new SQLException("create datasource connection error"));
|
future.completeExceptionally(new SQLException("create datasource connection error"));
|
||||||
@@ -119,7 +119,7 @@ public abstract class PoolTcpSource extends PoolSource<AsyncConnection> {
|
|||||||
if (!semaphore.tryAcquire()) {
|
if (!semaphore.tryAcquire()) {
|
||||||
return CompletableFuture.supplyAsync(() -> {
|
return CompletableFuture.supplyAsync(() -> {
|
||||||
try {
|
try {
|
||||||
return connQueue.poll(3, TimeUnit.SECONDS);
|
return connQueue.poll(1, TimeUnit.SECONDS);
|
||||||
} catch (Exception t) {
|
} catch (Exception t) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user