feat: add report material workflows and gateway safeguards

This commit is contained in:
hectorzhao
2026-07-15 18:23:48 +08:00
parent cf9f4ce4cd
commit 7091a8bed4
41 changed files with 3606 additions and 71 deletions
+6
View File
@@ -9,6 +9,7 @@ import (
"cmpp-platform/gateway/internal/control"
"cmpp-platform/gateway/internal/health"
"cmpp-platform/gateway/internal/inbound"
"cmpp-platform/gateway/internal/ratelimit"
"cmpp-platform/gateway/internal/submitworker"
"cmpp-platform/gateway/internal/upstream"
)
@@ -24,6 +25,10 @@ func main() {
}
apiBaseURL := os.Getenv("API_BASE_URL")
upstreamManager := &upstream.Manager{APIBaseURL: apiBaseURL}
channelLimiter, err := ratelimit.New(os.Getenv("REDIS_URL"))
if err != nil {
log.Fatalf("gateway channel rate limiter init failed: %v", err)
}
presenceStore, err := inbound.NewRedisPresenceStore(os.Getenv("REDIS_URL"))
if err != nil {
log.Printf("gateway downstream presence store init failed: %v", err)
@@ -69,6 +74,7 @@ func main() {
control.Register(mux, control.Server{
APIBaseURL: apiBaseURL,
Upstream: upstreamManager,
Limiter: channelLimiter,
RecoveryCandidates: func(ctx context.Context) ([]inbound.DownstreamPresence, error) {
return inbound.ListRecoveryCandidates(ctx, presenceStore)
},