Skip to content

Commit

Permalink
With the default ZConnectionPoolConfig if the connection fails, it'…
Browse files Browse the repository at this point in the history
…ll retry forever to connect and deadlock the program (#174)
  • Loading branch information
guizmaii authored Oct 27, 2023
1 parent c925ab4 commit 6667473
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/src/main/scala/zio/jdbc/ZConnectionPoolConfig.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ object ZConnectionPoolConfig {

lazy val default: ZConnectionPoolConfig = ZConnectionPoolConfig(8, 32, defaultRetryPolicy, 300.seconds)

lazy val defaultRetryPolicy: Schedule.WithState[Long, Any, Any, Duration] = Schedule.exponential(10.millis)
lazy val defaultRetryPolicy: Schedule.WithState[(Long, Long), Any, Any, (Long, Duration)] =
Schedule.recurs(10) && Schedule.exponential(15.millis)

implicit val config: Config[ZConnectionPoolConfig] =
(Config.int("minConnections") zip
Expand Down

0 comments on commit 6667473

Please sign in to comment.