mirror of
https://github.com/lukaszraczylo/traefik-llmgateway.git
synced 2026-11-27 10:16:34 +00:00
fix(shared-state): read calibrator counters without the limiter latch
The shared calibration refresh read through the limiter. A Redis error there latched the chat route's limiter store for five seconds. The refresh now reads the store directly, as the shared-state loop does.
This commit is contained in:
@@ -446,7 +446,7 @@ func (g *Gateway) calibrationTargets() []smartCalibKey {
|
||||
// refreshSharedCalibration reads the fleet counters of every calibrating router's targets and keeps one bytes-per-token ratio per model.
|
||||
// A failed read keeps the previous ratios.
|
||||
func (g *Gateway) refreshSharedCalibration(now time.Time) {
|
||||
if !g.tokenCalib.sharing() || g.limiter == nil {
|
||||
if !g.tokenCalib.sharing() || g.sharedState == nil {
|
||||
return
|
||||
}
|
||||
targets := g.calibrationTargets()
|
||||
@@ -463,7 +463,7 @@ func (g *Gateway) refreshSharedCalibration(now time.Time) {
|
||||
names = append(names, calibFleetKey(k, calibMetricBytes, bucket), calibFleetKey(k, calibMetricToken, bucket), calibFleetKey(k, calibMetricCount, bucket))
|
||||
}
|
||||
}
|
||||
vals, ok := g.limiter.chunkedGetMulti(names, usageModelsChunkKeys)
|
||||
vals, ok := g.sharedState.chunkedGet(names)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user