feat(httpapi): harden control plane and speed up prefix refresh

Очередь job получила lease и fencing, телеметрия и прогресс deploy сохраняются, ревизия пишет manifest входов. Обновление префиксов не переписывает неизменённый снимок, большие наборы идут через COPY, а устаревшая ревизия не попадает в deploy. Бандл ноды кэшируется, prune и постановка job больше не держат горячий путь.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
DenozordecandCursor committed 2026-11-02 17:23:59 +07:00
1 parent 924f111e48
commit f8e0520817
197 files changed
+18655 -1416

No files matched your search

+34
View File
@@ -0,0 +1,34 @@
package db
import (
"testing"
"time"
"github.com/jackc/pgx/v5/pgxpool"
)
func TestApplyPostgresPoolConfigDefaultAndExplicit(t *testing.T) {
t.Setenv("EVOBGP_DB_MAX_CONNS", "")
t.Setenv("EVOBGP_DB_MIN_CONNS", "")
cfg, err := pgxpool.ParseConfig("postgres://localhost/evobgp?sslmode=disable")
if err != nil {
t.Fatal(err)
}
applyPostgresPoolConfig(cfg)
if cfg.MaxConns != 8 {
t.Fatalf("default max conns: %d", cfg.MaxConns)
}
if cfg.MaxConnIdleTime != 5*time.Minute {
t.Fatalf("idle time: %s", cfg.MaxConnIdleTime)
}
t.Setenv("EVOBGP_DB_MAX_CONNS", "25")
cfg, err = pgxpool.ParseConfig("postgres://localhost/evobgp?sslmode=disable")
if err != nil {
t.Fatal(err)
}
applyPostgresPoolConfig(cfg)
if cfg.MaxConns != 25 {
t.Fatalf("explicit max conns overridden: %d", cfg.MaxConns)
}
}