️ feat: Update database connection pool configuration to optimize performance and resource management.

This commit is contained in:
jarvis2f 2025-02-06 18:02:30 +08:00
parent 60d561827a
commit 3ef7fe0a14

View file

@ -38,9 +38,12 @@ public class DataVerticle extends AbstractVerticle {
public void start(Promise<Void> stopPromise) { public void start(Promise<Void> stopPromise) {
pool = JDBCPool.pool(vertx, pool = JDBCPool.pool(vertx,
new JDBCConnectOptions() new JDBCConnectOptions()
.setJdbcUrl("jdbc:sqlite:%s".formatted(getDataPath())) .setJdbcUrl("jdbc:sqlite:%s?journal_mode=WAL&busy_timeout=30000&synchronous=NORMAL&cache_size=-2000".formatted(getDataPath())),
, new PoolOptions()
new PoolOptions().setMaxSize(16).setName("pool-tf") .setMaxSize(8)
.setName("pool-tf")
.setIdleTimeout(300000)
.setPoolCleanerPeriod(300000)
); );
settingRepository = new SettingRepositoryImpl(pool); settingRepository = new SettingRepositoryImpl(pool);
telegramRepository = new TelegramRepositoryImpl(pool); telegramRepository = new TelegramRepositoryImpl(pool);