[FIX] initializeAtStart thread safety

This commit is contained in:
Gravita 2024-09-28 02:29:19 +07:00
parent c7f4d8ac49
commit cc2bce4300
No known key found for this signature in database
GPG key ID: 543A8F335C9CD633

View file

@ -19,15 +19,15 @@ public class HikariSQLSourceConfig implements SQLSourceConfig {
private boolean initializeAtStart;
public void init() {
if (dataSource != null) {
return;
}
if(initializeAtStart) {
initializeConnection();
}
}
private void initializeConnection() {
if (dataSource != null) {
return;
}
HikariConfig config = new HikariConfig();
consumeIfNotNull(config::setDataSourceClassName, dsClass);
consumeIfNotNull(config::setDataSourceProperties, dsProps);