feat: add report material workflows and gateway safeguards
This commit is contained in:
@@ -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)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user