MCPcopy Create free account
hub / github.com/cloudbase/garm / SetEntityScaleSet

Method SetEntityScaleSet

cache/entity_cache.go:257–271  ·  view source on GitHub ↗
(entityID string, scaleSet params.ScaleSet)

Source from the content-addressed store, hash-verified

255}
256
257func (e *EntityCache) SetEntityScaleSet(entityID string, scaleSet params.ScaleSet) {
258 e.mux.Lock()
259 defer e.mux.Unlock()
260
261 scaleSetEntity, err := scaleSet.GetEntity()
262 if err != nil || scaleSetEntity.ID != entityID {
263 return
264 }
265
266 if cache, ok := e.entities[entityID]; ok {
267 e.scalesets[scaleSet.ID] = scaleSet
268 cache.ScaleSets[scaleSet.ID] = struct{}{}
269 e.entities[entityID] = cache
270 }
271}
272
273func (e *EntityCache) DeleteEntityPool(entityID string, poolID string) {
274 e.mux.Lock()

Callers 1

SetEntityScaleSetFunction · 0.80

Calls 3

LockMethod · 0.65
UnlockMethod · 0.65
GetEntityMethod · 0.65

Tested by

no test coverage detected