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,22 +248,23 @@ 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) {
log.warn( if (isTypeH2 && !isDBUrlH2) {
"Datasource type is H2, but the URL does not contain 'h2'. " log.warn(
+ "Please check your configuration."); "Datasource type is H2, but the URL does not contain 'h2'. "
throw new IllegalStateException( + "Please check your configuration.");
"Datasource type is H2, but the URL does not contain 'h2'. Please check your" throw new IllegalStateException(
+ " configuration."); "Datasource type is H2, but the URL does not contain 'h2'. Please check"
} else if (!isTypeH2 && isDBUrlH2 && isCustomDatabase) { + " your configuration.");
log.warn( } else if (!isTypeH2 && isDBUrlH2) {
"Datasource URL contains 'h2', but the type is not H2. " log.warn(
+ "Please check your configuration."); "Datasource URL contains 'h2', but the type is not H2. "
throw new IllegalStateException( + "Please check your configuration.");
"Datasource URL contains 'h2', but the type is not H2. Please check your" throw new IllegalStateException(
+ " configuration."); "Datasource URL contains 'h2', but the type is not H2. Please check your"
+ " configuration.");
}
} }
boolean isH2 = isTypeH2 && isDBUrlH2; boolean isH2 = isTypeH2 && isDBUrlH2;
return !isCustomDatabase || isH2; return !isCustomDatabase || isH2;