fix UI 503s under checkpoint load

- Store: skip identical CT checkpoint writes (CertSpotter calls StoreLogState
  per batch across 64 logs; hashing the state avoids redundant writes).
- webui: cache /api/stats for 10s and raise API query timeouts; UI polls, so
  repeated aggregate queries no longer queue behind checkpoint bursts.
- reword discovery detail (no 'name enumeration' for S3/GCS; only Azure uses a
  container list).
This commit is contained in:
StasonJatham committed 2026-09-22 17:45:18 +02:00
1 parent 32035d0b9d
commit 1ce5700cec
6 files changed
+50 -14

No files matched your search

+5 -1
View File
@@ -5,6 +5,7 @@ package store
import (
"context"
"fmt"
"sync"
"time"
"github.com/jackc/pgx/v5"
@@ -20,6 +21,9 @@ import (
type Store struct {
pool *pgxpool.Pool
metrics *metrics.Metrics
stateMu sync.Mutex
lastState map[string][32]byte // per-log checkpoint hash; skip identical writes
}
// Open connects to PostgreSQL. The pool is bounded; the caller configures the
@@ -38,7 +42,7 @@ func Open(ctx context.Context, databaseURL string, maxConns int) (*Store, error)
if err != nil {
return nil, err
}
return &Store{pool: pool}, nil
return &Store{pool: pool, lastState: make(map[string][32]byte)}, nil
}
func (s *Store) SetMetrics(m *metrics.Metrics) { s.metrics = m }