Changeset 0.28.8 (#194)

This commit is contained in:
2026-03-15 23:43:36 +00:00
parent 3237d55e0c
commit 128cbb8174
25 changed files with 1157 additions and 863 deletions

View File

@@ -7,6 +7,7 @@ import (
"os"
"path/filepath"
"strings"
"time"
_ "github.com/lib/pq"
_ "modernc.org/sqlite"
@@ -64,6 +65,8 @@ func connectPostgres(dsn string) error {
DB.SetMaxOpenConns(25)
DB.SetMaxIdleConns(5)
DB.SetConnMaxLifetime(5 * time.Minute) // recycle connections — prevents stale TCP after PG restart/network blip
DB.SetConnMaxIdleTime(1 * time.Minute) // close idle connections faster — reduces pool pressure after write bursts
if err := DB.Ping(); err != nil {
return fmt.Errorf("database ping: %w", err)