mirror of
https://github.com/gotson/komga.git
synced 2026-05-08 12:35:30 +02:00
fix: add configuration to set the database pool size
This commit is contained in:
parent
c962f8a7ab
commit
76e624140d
2 changed files with 4 additions and 0 deletions
|
|
@ -72,6 +72,9 @@ class KomgaProperties {
|
||||||
@get:Positive
|
@get:Positive
|
||||||
var batchChunkSize: Int = 1000
|
var batchChunkSize: Int = 1000
|
||||||
|
|
||||||
|
@get:Positive
|
||||||
|
var poolSize: Int? = null
|
||||||
|
|
||||||
@get:Positive
|
@get:Positive
|
||||||
var maxPoolSize: Int = 1
|
var maxPoolSize: Int = 1
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ class DataSourcesConfiguration(
|
||||||
|
|
||||||
val poolSize =
|
val poolSize =
|
||||||
if (komgaProperties.database.file.contains(":memory:")) 1
|
if (komgaProperties.database.file.contains(":memory:")) 1
|
||||||
|
else if (komgaProperties.database.poolSize != null) komgaProperties.database.poolSize!!
|
||||||
else Runtime.getRuntime().availableProcessors().coerceAtMost(komgaProperties.database.maxPoolSize)
|
else Runtime.getRuntime().availableProcessors().coerceAtMost(komgaProperties.database.maxPoolSize)
|
||||||
|
|
||||||
return HikariDataSource(
|
return HikariDataSource(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue