diff --git a/backend/windmill-common/src/lib.rs b/backend/windmill-common/src/lib.rs index 704948dd87..d0e7c6d652 100644 --- a/backend/windmill-common/src/lib.rs +++ b/backend/windmill-common/src/lib.rs @@ -1072,7 +1072,7 @@ impl TokioPgConnection { /// Without these, a server that vanishes without closing the socket (a failover, /// a dropped route) leaves a query waiting on a read for the OS default of two /// hours. The server's kernel answers the probes, so a slow query is unaffected. -fn set_pg_keepalive(config: &mut tokio_postgres::Config) { +pub fn set_pg_keepalive(config: &mut tokio_postgres::Config) { config .keepalives(true) .keepalives_idle(std::time::Duration::from_secs(60)) diff --git a/backend/windmill-trigger-postgres/src/lib.rs b/backend/windmill-trigger-postgres/src/lib.rs index 15918fca7b..94bc2b4a5e 100644 --- a/backend/windmill-trigger-postgres/src/lib.rs +++ b/backend/windmill-trigger-postgres/src/lib.rs @@ -355,6 +355,8 @@ pub async fn get_raw_postgres_connection( config.options(options); } + windmill_common::set_pg_keepalive(&mut config); + let connector = build_tls_connector(ssl_mode, database.root_certificate_pem.as_ref())?; let client = if let Some(connector) = connector { let (client, connection) = config.connect(connector).await.map_err(to_anyhow)?;