mirror of
https://github.com/lukaszraczylo/traefik-llmgateway.git
synced 2026-11-26 10:06:31 +00:00
The request breaker now also reads and writes the fleet breaker when redis.sharedState is on. A pod that sees enough failures opens the breaker for every pod after one refresh. A success on any pod closes it again. With the switch off, the tracker runs its local code only and makes no store call.
14 lines
498 B
Go
14 lines
498 B
Go
package traefikllmgateway
|
|
|
|
// wireSharedState layers fleet-wide state over the local trackers. It is a no-op without a shared-state loop.
|
|
func (g *Gateway) wireSharedState(cfg *Config) {
|
|
if g.sharedState == nil {
|
|
return
|
|
}
|
|
ids := sharedStateIDs(cfg)
|
|
if g.failoverHealth != nil {
|
|
g.failoverHealth.share(newSharedBreaker(g.sharedState, sharedKindRequest, ids,
|
|
requestBreakerFailureThreshold, requestBreakerOpenDuration, requestBreakerMaxOpenDuration, 2*requestBreakerMaxOpenDuration))
|
|
}
|
|
}
|