File tree Expand file tree Collapse file tree
modules/library/src/main/java/top/mrxiaom/pluginbase Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -155,6 +155,9 @@ private void reloadFromFile(File file) {
155155 hikariConfig .setMinimumIdle (config .getInt ("hikari.minimum_idle" , 8 ));
156156 hikariConfig .setMaximumPoolSize (config .getInt ("hikari.maximum_pool_size" , 36 ));
157157 }
158+ for (IDatabase db : databases ) {
159+ db .beforeReload (hikariConfig , config );
160+ }
158161 if (isMySQL ()) {
159162 String host = config .getString ("mysql.host" , "localhost" );
160163 int port = config .getInt ("mysql.port" , 3306 );
Original file line number Diff line number Diff line change 11package top .mrxiaom .pluginbase .database ;
22
3+ import com .zaxxer .hikari .HikariConfig ;
4+ import org .bukkit .configuration .file .YamlConfiguration ;
5+
36import java .sql .Connection ;
47import java .sql .SQLException ;
58
69/**
710 * 数据库信号接收器
811 */
912public interface IDatabase {
13+ default void beforeReload (HikariConfig hikariConfig , YamlConfiguration config ) {
14+ }
1015 /**
1116 * 用户重载数据库时执行的操作,推荐在这里创建数据表
1217 * @param conn 数据库连接
You can’t perform that action at this time.
0 commit comments