mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-09-12 17:52:13 +02:00
Update DatabaseService.java
This commit is contained in:
parent
7fae826f9c
commit
33efd5ed8e
@ -248,14 +248,15 @@ public class DatabaseService implements DatabaseInterface {
|
||||
|| datasource.getCustomDatabaseUrl().contains("H2");
|
||||
boolean isCustomDatabase = datasource.isEnableCustomDatabase();
|
||||
|
||||
if (isTypeH2 && !isDBUrlH2 && isCustomDatabase) {
|
||||
if (isCustomDatabase) {
|
||||
if (isTypeH2 && !isDBUrlH2) {
|
||||
log.warn(
|
||||
"Datasource type is H2, but the URL does not contain 'h2'. "
|
||||
+ "Please check your configuration.");
|
||||
throw new IllegalStateException(
|
||||
"Datasource type is H2, but the URL does not contain 'h2'. Please check your"
|
||||
+ " configuration.");
|
||||
} else if (!isTypeH2 && isDBUrlH2 && isCustomDatabase) {
|
||||
"Datasource type is H2, but the URL does not contain 'h2'. Please check"
|
||||
+ " your configuration.");
|
||||
} else if (!isTypeH2 && isDBUrlH2) {
|
||||
log.warn(
|
||||
"Datasource URL contains 'h2', but the type is not H2. "
|
||||
+ "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"
|
||||
+ " configuration.");
|
||||
}
|
||||
|
||||
}
|
||||
boolean isH2 = isTypeH2 && isDBUrlH2;
|
||||
|
||||
return !isCustomDatabase || isH2;
|
||||
|
Loading…
Reference in New Issue
Block a user