feat: runtime bootstrap snapshot cache with backoff
This commit is contained in:
1 parent
08f60a14d1
commit
aa6bb23e24
19 files changed
+1400
-384
No files matched your search
@@ -83,6 +83,14 @@ func (s *Server) refreshSimulation(state model.ScenarioState) {
|
||||
s.simFor = state.Scenario.Scenario
|
||||
s.simGen++
|
||||
s.staffing = make(map[string]model.StaffingResponse)
|
||||
for sensorID, horizons := range forecasts {
|
||||
for horizon, points := range horizons {
|
||||
if len(points) == 0 {
|
||||
continue
|
||||
}
|
||||
s.lastForecast[forecastKey(sensorID, horizon, state.Scenario.Scenario)] = sortedForecast(points)
|
||||
}
|
||||
}
|
||||
s.mu.Unlock()
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user