mirror of
https://gitee.com/dromara/dbswitch.git
synced 2025-09-21 11:37:40 +00:00
fix bug from issue
This commit is contained in:
@@ -11,6 +11,12 @@ services:
|
||||
MYSQL_PASSWORD: 123456
|
||||
MYSQL_ROOT_PASSWORD: 123456
|
||||
MYSQL_ROOT_HOST: '%'
|
||||
healthcheck:
|
||||
test: ["CMD", "mysql", "-uroot", "-p123456" ,"-e"," select 1 "]
|
||||
interval: 10s
|
||||
timeout: 3s
|
||||
retries: 60
|
||||
start_period: 30s
|
||||
dbswitch:
|
||||
container_name: dbswitch_webui
|
||||
image: inrgihc/dbswitch:1.7.0
|
||||
|
@@ -75,11 +75,6 @@ public final class JDBCURL {
|
||||
*/
|
||||
public static boolean reachable(String host, String port) {
|
||||
try {
|
||||
InetAddress address = InetAddress.getByName(host);
|
||||
if (!address.isReachable(1500)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
try (Socket socket = new Socket()) {
|
||||
socket.connect(new InetSocketAddress(host, Integer.parseInt(port)), 1500);
|
||||
}
|
||||
|
@@ -56,7 +56,7 @@ import org.springframework.util.StringUtils;
|
||||
@Slf4j
|
||||
public class MigrationHandler implements Supplier<Long> {
|
||||
|
||||
private final long MAX_CACHE_BYTES_SIZE = 128 * 1024 * 1024;
|
||||
private final long MAX_CACHE_BYTES_SIZE = 512 * 1024 * 1024;
|
||||
|
||||
private int fetchSize = 100;
|
||||
private final DbswichProperties properties;
|
||||
|
@@ -111,8 +111,13 @@ public final class DataSourceUtils {
|
||||
} else {
|
||||
ds.setConnectionTestQuery("SELECT 1");
|
||||
}
|
||||
ds.setMaximumPoolSize(MAX_THREAD_COUNT);
|
||||
ds.setMinimumIdle(MAX_THREAD_COUNT);
|
||||
if (properties.getDriverClassName().contains("sqlite")) {
|
||||
ds.setMaximumPoolSize(1);
|
||||
ds.setMinimumIdle(1);
|
||||
} else {
|
||||
ds.setMaximumPoolSize(MAX_THREAD_COUNT);
|
||||
ds.setMinimumIdle(MAX_THREAD_COUNT);
|
||||
}
|
||||
ds.setMaxLifetime(properties.getMaxLifeTime());
|
||||
ds.setConnectionTimeout(properties.getConnectionTimeout());
|
||||
ds.setIdleTimeout(MAX_TIMEOUT_MS);
|
||||
|
Reference in New Issue
Block a user