Skip to content

Commit bae12fc

Browse files
authored
feat: set keepalive for pgcat server itself (#402)
* feat: set keepalive for pgcat server self * docs: note also set for client
1 parent 421c5d4 commit bae12fc

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CONFIG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# PgCat Configurations
1+
# PgCat Configurations
22
## `general` Section
33

44
### host
@@ -127,7 +127,7 @@ path: general.tcp_keepalives_idle
127127
default: 5
128128
```
129129

130-
Number of seconds of connection idleness to wait before sending a keepalive packet to the server.
130+
Number of seconds of connection idleness to wait before sending a keepalive packet to the server and client.
131131

132132
### tcp_keepalives_count
133133
```

src/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ mod stats;
7979
mod tls;
8080

8181
use crate::config::{get_config, reload_config, VERSION};
82+
use crate::messages::configure_socket;
8283
use crate::pool::{ClientServerMap, ConnectionPool};
8384
use crate::prometheus::start_metric_server;
8485
use crate::stats::{Collector, Reporter, REPORTER};
@@ -289,6 +290,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
289290

290291
let tls_certificate = get_config().general.tls_certificate.clone();
291292

293+
configure_socket(&socket);
294+
292295
tokio::task::spawn(async move {
293296
let start = chrono::offset::Utc::now().naive_utc();
294297

0 commit comments

Comments
 (0)