Skip to content

Commit

Permalink
fix(init): 修复SQL配置的Initializer未被调用的问题。
Browse files Browse the repository at this point in the history
  • Loading branch information
CarmJos committed Apr 16, 2023
1 parent 40afd98 commit 62a8bc4
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>minesql-parent</artifactId>
<groupId>cc.carm.plugin</groupId>
<version>1.4.0</version>
<version>1.4.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>minesql-parent</artifactId>
<groupId>cc.carm.plugin</groupId>
<version>1.4.0</version>
<version>1.4.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<properties>
Expand Down
9 changes: 7 additions & 2 deletions core/src/main/java/cc/carm/plugin/minesql/MineSQLCore.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public static MineSQLCore getInstance() {
}

@Override
public @NotNull SQLManagerImpl create(@NotNull String name, @NotNull SQLSourceConfig conf) {
public @NotNull SQLManagerImpl create(@NotNull String name, @NotNull SQLSourceConfig conf) throws Exception {
BeeDataSourceConfig config = new BeeDataSourceConfig();
config.setDriverClassName(conf.getDriverClassName());
config.setJdbcUrl(conf.getJdbcURL());
Expand All @@ -147,7 +147,12 @@ public static MineSQLCore getInstance() {
Optional.ofNullable(conf.getSettings().getValidationTimeout()).ifPresent(config::setValidTestTimeout);
Optional.ofNullable(conf.getSettings().getValidationInterval()).ifPresent(config::setValidAssumeTime);

return create(name, config);
SQLManagerImpl manager = create(name, config);
if (conf.getInitializer() != null) {
conf.getInitializer().accept(manager);
}

return manager;
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion platforms/bukkit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>minesql-parent</artifactId>
<groupId>cc.carm.plugin</groupId>
<version>1.4.0</version>
<version>1.4.1</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion platforms/bungee/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>minesql-parent</artifactId>
<groupId>cc.carm.plugin</groupId>
<version>1.4.0</version>
<version>1.4.1</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion platforms/sponge8/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>minesql-parent</artifactId>
<groupId>cc.carm.plugin</groupId>
<version>1.4.0</version>
<version>1.4.1</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion platforms/velocity/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>minesql-parent</artifactId>
<groupId>cc.carm.plugin</groupId>
<version>1.4.0</version>
<version>1.4.1</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>minesql-parent</artifactId>
<groupId>cc.carm.plugin</groupId>
<version>1.4.0</version>
<version>1.4.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<properties>
Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>

<deps.easysql.version>0.4.7</deps.easysql.version>
<deps.easyconf.version>3.3.1</deps.easyconf.version>
<deps.easyplugin.version>1.4.18</deps.easyplugin.version>
<deps.easyconf.version>3.5.1</deps.easyconf.version>
<deps.easyplugin.version>1.5.5</deps.easyplugin.version>
<deps.beecp.version>3.3.9</deps.beecp.version>

<deps.libby.version>1.1.5</deps.libby.version>
Expand All @@ -30,7 +30,7 @@
<groupId>cc.carm.plugin</groupId>
<artifactId>minesql-parent</artifactId>
<packaging>pom</packaging>
<version>1.4.0</version>
<version>1.4.1</version>
<modules>
<module>api</module>
<module>core</module>
Expand Down Expand Up @@ -128,7 +128,7 @@
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>23.1.0</version>
<version>24.0.1</version>
<scope>provided</scope>
</dependency>

Expand Down

0 comments on commit 62a8bc4

Please sign in to comment.