platform: modularize api/gui, add docs-tests-web foundation, and refresh root config

This commit is contained in:
beckline
2026-03-26 22:40:54 +03:00
parent 0e2d7f61ea
commit 6a56d734c2
562 changed files with 70151 additions and 16423 deletions

View File

@@ -0,0 +1,37 @@
package app
import (
"sync"
"time"
)
const (
transportHealthFreshTTL = 45 * time.Second
transportHealthBackoffMin = 5 * time.Second
transportHealthBackoffMax = 2 * time.Minute
transportHealthPersistMinAge = 90 * time.Second
transportHealthMaxConcurrentProbe = 2
)
type transportHealthRefreshEntry struct {
swr refreshCoordinator
}
type transportHealthRefresher struct {
mu sync.Mutex
entries map[string]*transportHealthRefreshEntry
sem chan struct{}
}
func newTransportHealthRefresher(maxConcurrent int) *transportHealthRefresher {
n := maxConcurrent
if n <= 0 {
n = transportHealthMaxConcurrentProbe
}
return &transportHealthRefresher{
entries: map[string]*transportHealthRefreshEntry{},
sem: make(chan struct{}, n),
}
}
var transportHealthSWR = newTransportHealthRefresher(envInt("SVPN_TRANSPORT_HEALTH_MAX_PARALLEL", transportHealthMaxConcurrentProbe))