fix: add configuration to set the database pool size

This commit is contained in:
Gauthier Roebroeck 2022-07-28 09:47:22 +08:00
parent c962f8a7ab
commit 76e624140d
2 changed files with 4 additions and 0 deletions

View File

@ -72,6 +72,9 @@ class KomgaProperties {
@get:Positive
var batchChunkSize: Int = 1000
@get:Positive
var poolSize: Int? = null
@get:Positive
var maxPoolSize: Int = 1

View File

@ -37,6 +37,7 @@ class DataSourcesConfiguration(
val poolSize =
if (komgaProperties.database.file.contains(":memory:")) 1
else if (komgaProperties.database.poolSize != null) komgaProperties.database.poolSize!!
else Runtime.getRuntime().availableProcessors().coerceAtMost(komgaProperties.database.maxPoolSize)
return HikariDataSource(