mirror of
https://github.com/nolen777/eagle0.git
synced 2026-07-28 20:55:44 +00:00
Disable Postgres leak tracing by default (#8712)
This commit is contained in:
@@ -53,7 +53,8 @@ case class PostgresConfig(
|
||||
}
|
||||
|
||||
object PostgresConfig {
|
||||
private[postgres] val DefaultMinimumIdle = 1
|
||||
private[postgres] val DefaultMinimumIdle = 1
|
||||
private[postgres] val DefaultLeakDetectionThresholdMillis = 0L
|
||||
|
||||
def fromEnvironment: Option[PostgresConfig] =
|
||||
for
|
||||
@@ -74,8 +75,10 @@ object PostgresConfig {
|
||||
idleTimeoutMillis = PostgresConnectionProvider.envLong("EAGLE_POSTGRES_IDLE_TIMEOUT_MILLIS", 120000L),
|
||||
maxLifetimeMillis = PostgresConnectionProvider.envLong("EAGLE_POSTGRES_MAX_LIFETIME_MILLIS", 1500000L),
|
||||
keepaliveTimeMillis = PostgresConnectionProvider.envLong("EAGLE_POSTGRES_KEEPALIVE_TIME_MILLIS", 300000L),
|
||||
leakDetectionThresholdMillis =
|
||||
PostgresConnectionProvider.envLong("EAGLE_POSTGRES_LEAK_DETECTION_THRESHOLD_MILLIS", 60000L)
|
||||
leakDetectionThresholdMillis = PostgresConnectionProvider.envLong(
|
||||
"EAGLE_POSTGRES_LEAK_DETECTION_THRESHOLD_MILLIS",
|
||||
DefaultLeakDetectionThresholdMillis
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,10 @@ class PostgresConnectionProviderTest extends AnyFlatSpec with Matchers {
|
||||
PostgresConfig.DefaultMinimumIdle shouldBe 1
|
||||
}
|
||||
|
||||
it should "disable connection leak tracing by default" in {
|
||||
PostgresConfig.DefaultLeakDetectionThresholdMillis shouldBe 0L
|
||||
}
|
||||
|
||||
"PostgresConfig.jdbcUrl" should "enable PostgreSQL batched insert rewriting" in {
|
||||
val config = PostgresConfig(
|
||||
host = "postgres.example.com",
|
||||
|
||||
Reference in New Issue
Block a user