From 795eb76f9ae1c0897e1879bf2cfb11102e62582d Mon Sep 17 00:00:00 2001 From: MechaCat02 Date: Tue, 7 Jul 2026 21:18:49 +0200 Subject: [PATCH] fix: document and wire the DB pool env vars into compose The new DB_MAX_CONNECTIONS / DB_ACQUIRE_TIMEOUT_SECS knobs were read by the backend but never added to .env.example or docker-compose.yml, so an operator setting them in .env would see no effect (caught by the config meta-tests). Document both in .env.example and wire them into backend.environment. Bump to 0.124.8. Co-Authored-By: Claude Opus 4.8 (1M context) --- .env.example | 6 ++++++ backend/Cargo.lock | 2 +- backend/Cargo.toml | 2 +- docker-compose.yml | 3 +++ frontend/package.json | 2 +- 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index c35849e..66700a6 100644 --- a/.env.example +++ b/.env.example @@ -25,6 +25,12 @@ DATABASE_URL=postgres://mangalord:mangalord@postgres:5432/mangalord BIND_ADDRESS=0.0.0.0:8080 STORAGE_DIR=/var/lib/mangalord/storage RUST_LOG=info,mangalord=debug,chromiumoxide::conn=off,chromiumoxide::handler=off +# Postgres connection-pool sizing. One pool serves HTTP handlers and the +# crawler/analysis daemons. DB_MAX_CONNECTIONS caps open connections; +# DB_ACQUIRE_TIMEOUT_SECS is how long a request waits for a free connection +# before failing fast (rather than hanging on the driver's 30s default). +DB_MAX_CONNECTIONS=20 +DB_ACQUIRE_TIMEOUT_SECS=10 # ----- Auth / cookies ----- # COOKIE_SECURE controls whether the `Secure` flag is set on the session diff --git a/backend/Cargo.lock b/backend/Cargo.lock index 907c261..66277fa 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -1558,7 +1558,7 @@ checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" [[package]] name = "mangalord" -version = "0.124.7" +version = "0.124.8" dependencies = [ "anyhow", "argon2", diff --git a/backend/Cargo.toml b/backend/Cargo.toml index 27b5b35..760687c 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mangalord" -version = "0.124.7" +version = "0.124.8" edition = "2021" default-run = "mangalord" diff --git a/docker-compose.yml b/docker-compose.yml index 0a60471..29a275e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -71,6 +71,9 @@ services: BIND_ADDRESS: 0.0.0.0:8080 STORAGE_DIR: /var/lib/mangalord/storage RUST_LOG: ${RUST_LOG:-info,mangalord=debug} + # Postgres connection-pool sizing — see .env.example for context. + DB_MAX_CONNECTIONS: ${DB_MAX_CONNECTIONS:-20} + DB_ACQUIRE_TIMEOUT_SECS: ${DB_ACQUIRE_TIMEOUT_SECS:-10} # Auth / cookies — see .env.example for context. COOKIE_SECURE: ${COOKIE_SECURE:-true} COOKIE_DOMAIN: ${COOKIE_DOMAIN:-} diff --git a/frontend/package.json b/frontend/package.json index a0d539c..af347bd 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "mangalord-frontend", - "version": "0.124.7", + "version": "0.124.8", "private": true, "type": "module", "scripts": {