judu/ex-egopublic Fork
⑂ 95ede89
Commits
⬇ Clone ▾
git clone https://git.rickub.com/judu/ex-ego.git
git clone ssh://git@rickub.com/judu/ex-ego.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP

fix(db): pool à 2 connexions + idle 30 s — cohabitation bleu-vert sur le plan PG à 5 connexionsUnverified

Julien Durillon committed 2026-08-08T09:54:46+02:00 Browse files
95ede89 parent: 985a720
modified src/main.rs +5 -1
@@ -90,8 +90,12 @@ async fn serve() -> Result<()> {
9090 )
9191 .init();
9292
93+ // Le plan PostgreSQL est limité à 5 connexions : 2 max par instance pour
94+ // que l'ancienne et la nouvelle cohabitent pendant un déploiement
95+ // bleu-vert, et libération rapide des connexions inactives.
9396 let pool = PgPoolOptions::new()
94- .max_connections(5)
97+ .max_connections(2)
98+ .idle_timeout(std::time::Duration::from_secs(30))
9599 .connect_with(config::pg_options()?)
96100 .await
97101 .context("connexion à la base")?;
@@ -90,8 +90,12 @@ async fn serve() -> Result<()> {
90 )90 )
91 .init();91 .init();
92 92
93+ // Le plan PostgreSQL est limité à 5 connexions : 2 max par instance pour
94+ // que l'ancienne et la nouvelle cohabitent pendant un déploiement
95+ // bleu-vert, et libération rapide des connexions inactives.
93 let pool = PgPoolOptions::new()96 let pool = PgPoolOptions::new()
94- .max_connections(5)97+ .max_connections(2)
98+ .idle_timeout(std::time::Duration::from_secs(30))
95 .connect_with(config::pg_options()?)99 .connect_with(config::pg_options()?)
96 .await100 .await
97 .context("connexion à la base")?;101 .context("connexion à la base")?;