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
d95f169ebd
commit
7fae826f9c
@ -246,15 +246,16 @@ public class DatabaseService implements DatabaseInterface {
|
|||||||
boolean isDBUrlH2 =
|
boolean isDBUrlH2 =
|
||||||
datasource.getCustomDatabaseUrl().contains("h2")
|
datasource.getCustomDatabaseUrl().contains("h2")
|
||||||
|| datasource.getCustomDatabaseUrl().contains("H2");
|
|| datasource.getCustomDatabaseUrl().contains("H2");
|
||||||
|
boolean isCustomDatabase = datasource.isEnableCustomDatabase();
|
||||||
|
|
||||||
if (isTypeH2 && !isDBUrlH2) {
|
if (isTypeH2 && !isDBUrlH2 && isCustomDatabase) {
|
||||||
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 your"
|
||||||
+ " configuration.");
|
+ " configuration.");
|
||||||
} else if (!isTypeH2 && isDBUrlH2) {
|
} else if (!isTypeH2 && isDBUrlH2 && isCustomDatabase) {
|
||||||
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.");
|
||||||
@ -265,7 +266,7 @@ public class DatabaseService implements DatabaseInterface {
|
|||||||
|
|
||||||
boolean isH2 = isTypeH2 && isDBUrlH2;
|
boolean isH2 = isTypeH2 && isDBUrlH2;
|
||||||
|
|
||||||
return !datasource.isEnableCustomDatabase() || isH2;
|
return !isCustomDatabase || isH2;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user