File tree Expand file tree Collapse file tree
server/src/main/scala/scaladex/server/service Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,21 +13,6 @@ scaladex {
1313 name = ${?POSTGRESQL_DATABASE}
1414 port = 5432
1515 url = "jdbc:postgresql://"${scaladex.database.user}":"${scaladex.database.password}"@localhost:"${scaladex.database.port}"/"${scaladex.database.name}
16-
17- pool {
18- maximum-pool-size = 20
19- maximum-pool-size = ${?DB_POOL_MAX_SIZE}
20- minimum-idle = 5
21- minimum-idle = ${?DB_POOL_MIN_IDLE}
22- connection-timeout-ms = 30000
23- connection-timeout-ms = ${?DB_CONNECTION_TIMEOUT_MS}
24- idle-timeout-ms = 600000
25- idle-timeout-ms = ${?DB_IDLE_TIMEOUT_MS}
26- max-lifetime-ms = 1800000
27- max-lifetime-ms = ${?DB_MAX_LIFETIME_MS}
28- leak-detection-threshold-ms = 60000
29- leak-detection-threshold-ms = ${?DB_LEAK_DETECTION_MS}
30- }
3116 }
3217 github {
3318 # follow this tutorial to create your token https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
Load diff This file was deleted.
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ package scaladex.infra.sql
22
33import scala .concurrent .ExecutionContext
44
5- import scaladex .infra .config .DatabasePoolConfig
65import scaladex .infra .config .PostgreSQLConfig
76
87import cats .effect .*
@@ -29,20 +28,11 @@ object DoobieUtils:
2928 .load()
3029
3130 def getHikariDataSource (conf : PostgreSQLConfig ): HikariDataSource =
32- getHikariDataSource(conf, DatabasePoolConfig .load().getOrElse(DatabasePoolConfig .default))
33-
34- def getHikariDataSource (conf : PostgreSQLConfig , poolConfig : DatabasePoolConfig ): HikariDataSource =
3531 val config : HikariConfig = new HikariConfig ()
3632 config.setDriverClassName(conf.driver)
3733 config.setJdbcUrl(conf.url)
3834 config.setUsername(conf.user)
3935 config.setPassword(conf.pass.decode)
40- config.setMaximumPoolSize(poolConfig.maximumPoolSize)
41- config.setMinimumIdle(poolConfig.minimumIdle)
42- config.setConnectionTimeout(poolConfig.connectionTimeoutMs)
43- config.setIdleTimeout(poolConfig.idleTimeoutMs)
44- config.setMaxLifetime(poolConfig.maxLifetimeMs)
45- config.setLeakDetectionThreshold(poolConfig.leakDetectionThresholdMs)
4636 new HikariDataSource (config)
4737 end getHikariDataSource
4838
Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ class MavenCentralService(
8282 yield result
8383
8484 loop(0 , 0 ).map(n => s " Inserted $n missing poms " )
85+ end findMissing
8586
8687 private def findAndIndexMissingArtifacts (
8788 groupId : GroupId ,
@@ -113,6 +114,7 @@ class MavenCentralService(
113114 else Future .successful(next)
114115 yield result
115116 loop(0 , Set .empty)
117+ end loadKnownRefs
116118
117119 /** Process items in pages, with a short delay between full pages. */
118120 private def processPages [A ](items : Seq [A ], pageSize : Int )(process : Seq [A ] => Future [Int ]): Future [Int ] =
@@ -127,7 +129,9 @@ class MavenCentralService(
127129 if batch.size == pageSize then delay(pageDelay).flatMap(_ => loop(page + 1 , next))
128130 else Future .successful(next)
129131 yield result
132+ end loop
130133 loop(0 , 0 )
134+ end processPages
131135
132136 private def delay (duration : FiniteDuration ): Future [Unit ] =
133137 after(duration, system.scheduler)(Future .successful(()))
You can’t perform that action at this time.
0 commit comments