mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 03:31:15 +03:00
[FIX] initializeAtStart thread safety
This commit is contained in:
parent
c7f4d8ac49
commit
cc2bce4300
1 changed files with 3 additions and 3 deletions
|
@ -19,15 +19,15 @@ public class HikariSQLSourceConfig implements SQLSourceConfig {
|
||||||
private boolean initializeAtStart;
|
private boolean initializeAtStart;
|
||||||
|
|
||||||
public void init() {
|
public void init() {
|
||||||
if (dataSource != null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(initializeAtStart) {
|
if(initializeAtStart) {
|
||||||
initializeConnection();
|
initializeConnection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initializeConnection() {
|
private void initializeConnection() {
|
||||||
|
if (dataSource != null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
HikariConfig config = new HikariConfig();
|
HikariConfig config = new HikariConfig();
|
||||||
consumeIfNotNull(config::setDataSourceClassName, dsClass);
|
consumeIfNotNull(config::setDataSourceClassName, dsClass);
|
||||||
consumeIfNotNull(config::setDataSourceProperties, dsProps);
|
consumeIfNotNull(config::setDataSourceProperties, dsProps);
|
||||||
|
|
Loading…
Reference in a new issue