Update DatabaseService.java

This commit is contained in:
Ludy 2025-05-02 00:20:41 +02:00 committed by GitHub
parent 7fae826f9c
commit 33efd5ed8e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -248,14 +248,15 @@ public class DatabaseService implements DatabaseInterface {
|| datasource.getCustomDatabaseUrl().contains("H2"); || datasource.getCustomDatabaseUrl().contains("H2");
boolean isCustomDatabase = datasource.isEnableCustomDatabase(); boolean isCustomDatabase = datasource.isEnableCustomDatabase();
if (isTypeH2 && !isDBUrlH2 && isCustomDatabase) { if (isCustomDatabase) {
if (isTypeH2 && !isDBUrlH2) {
log.warn( log.warn(
"Datasource type is H2, but the URL does not contain 'h2'. " "Datasource type is H2, but the URL does not contain 'h2'. "
+ "Please check your configuration."); + "Please check your configuration.");
throw new IllegalStateException( throw new IllegalStateException(
"Datasource type is H2, but the URL does not contain 'h2'. Please check your" "Datasource type is H2, but the URL does not contain 'h2'. Please check"
+ " configuration."); + " your configuration.");
} else if (!isTypeH2 && isDBUrlH2 && isCustomDatabase) { } else if (!isTypeH2 && isDBUrlH2) {
log.warn( log.warn(
"Datasource URL contains 'h2', but the type is not H2. " "Datasource URL contains 'h2', but the type is not H2. "
+ "Please check your configuration."); + "Please check your configuration.");
@ -263,7 +264,7 @@ public class DatabaseService implements DatabaseInterface {
"Datasource URL contains 'h2', but the type is not H2. Please check your" "Datasource URL contains 'h2', but the type is not H2. Please check your"
+ " configuration."); + " configuration.");
} }
}
boolean isH2 = isTypeH2 && isDBUrlH2; boolean isH2 = isTypeH2 && isDBUrlH2;
return !isCustomDatabase || isH2; return !isCustomDatabase || isH2;