Skip to content

Commit

Permalink
bring back closeCallsExceeding from poolSettings for existing api
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-alfers committed Nov 26, 2024
1 parent 4811554 commit 042ee83
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ object R2dbcSession {
fun: R2dbcSession => Future[A]): Future[A] = {
val connectionFactoryProvider = ConnectionFactoryProvider(system)
val connectionFactory = connectionFactoryProvider.connectionFactoryFor(connectionFactoryConfigPath)
withSession(system, connectionFactory)(fun)
val poolSettings = new ConnectionPoolSettings(system.settings.config.getConfig(connectionFactoryConfigPath))
withSession(system, connectionFactory, poolSettings.closeCallsExceeding)(fun)
}

/**
Expand All @@ -48,8 +49,13 @@ object R2dbcSession {
fun: R2dbcSession => Future[A]): Future[A] = {
val poolConfig = system.settings.config.getConfig(connectionFactoryConfigPath(system))
val poolSettings = new ConnectionPoolSettings(poolConfig)
withSession(system, connectionFactory, poolSettings.closeCallsExceeding)(fun)
}

@InternalApi private[akka] def withSession[A](system: ActorSystem[_], connectionFactory: ConnectionFactory, closeCallsExceeding: Option[FiniteDuration])(
fun: R2dbcSession => Future[A]): Future[A] = {
val r2dbcExecutor =
new R2dbcExecutor(connectionFactory, log, logDbCallsDisabled, poolSettings.closeCallsExceeding)(
new R2dbcExecutor(connectionFactory, log, logDbCallsDisabled, closeCallsExceeding)(
system.executionContext,
system)
r2dbcExecutor.withConnection("R2dbcSession") { connection =>
Expand Down

0 comments on commit 042ee83

Please sign in to comment.