mirror of
https://github.com/Suwayomi/Tachidesk.git
synced 2025-12-10 06:42:07 +01:00
@@ -50,8 +50,6 @@ object DBManager {
|
|||||||
password = serverConfig.databasePassword.value
|
password = serverConfig.databasePassword.value
|
||||||
// PostgreSQL specific optimizations
|
// PostgreSQL specific optimizations
|
||||||
addDataSourceProperty("cachePrepStmts", "true")
|
addDataSourceProperty("cachePrepStmts", "true")
|
||||||
addDataSourceProperty("prepStmtCacheSize", "25")
|
|
||||||
addDataSourceProperty("prepStmtCacheSqlLimit", "256")
|
|
||||||
addDataSourceProperty("useServerPrepStmts", "true")
|
addDataSourceProperty("useServerPrepStmts", "true")
|
||||||
}
|
}
|
||||||
DatabaseType.H2 -> {
|
DatabaseType.H2 -> {
|
||||||
@@ -121,8 +119,14 @@ object DBManager {
|
|||||||
private val logger = KotlinLogging.logger {}
|
private val logger = KotlinLogging.logger {}
|
||||||
|
|
||||||
fun databaseUp() {
|
fun databaseUp() {
|
||||||
val db = DBManager.setupDatabase()
|
val db =
|
||||||
// call db to initialize the lazy object
|
try {
|
||||||
|
DBManager.setupDatabase()
|
||||||
|
} catch (e: Exception) {
|
||||||
|
logger.error(e) { "Failed to setup Database" }
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
logger.info {
|
logger.info {
|
||||||
"Using ${db.vendor} database version ${db.version}"
|
"Using ${db.vendor} database version ${db.version}"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user