feat: set keepalive for pgcat server itself (#402)

* feat: set keepalive for pgcat server self

* docs: note also set for client
This commit is contained in:
Cluas
2023-04-13 00:29:43 +08:00
committed by GitHub
parent 421c5d4b64
commit bae12fca99
2 changed files with 5 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
# PgCat Configurations
# PgCat Configurations
## `general` Section
### host
@@ -127,7 +127,7 @@ path: general.tcp_keepalives_idle
default: 5
```
Number of seconds of connection idleness to wait before sending a keepalive packet to the server.
Number of seconds of connection idleness to wait before sending a keepalive packet to the server and client.
### tcp_keepalives_count
```

View File

@@ -79,6 +79,7 @@ mod stats;
mod tls;
use crate::config::{get_config, reload_config, VERSION};
use crate::messages::configure_socket;
use crate::pool::{ClientServerMap, ConnectionPool};
use crate::prometheus::start_metric_server;
use crate::stats::{Collector, Reporter, REPORTER};
@@ -289,6 +290,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let tls_certificate = get_config().general.tls_certificate.clone();
configure_socket(&socket);
tokio::task::spawn(async move {
let start = chrono::offset::Utc::now().naive_utc();