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

Method GetEntityPools

cache/entity_cache.go:343–359  ·  view source on GitHub ↗
(entityID string)

Source from the content-addressed store, hash-verified

341}
342
343func (e *EntityCache) GetEntityPools(entityID string) []params.Pool {
344 e.mux.Lock()
345 defer e.mux.Unlock()
346
347 if cache, ok := e.entities[entityID]; ok {
348 var pools []params.Pool
349 for poolID := range cache.Pools {
350 if pool, ok := e.pools[poolID]; ok {
351 pools = append(pools, pool)
352 }
353 }
354 // Sort the pools by creation date.
355 sortByCreationDate(pools)
356 return pools
357 }
358 return nil
359}
360
361func (e *EntityCache) GetEntityScaleSets(entityID string) []params.ScaleSet {
362 e.mux.Lock()

Callers 1

GetEntityPoolsFunction · 0.80

Calls 3

sortByCreationDateFunction · 0.85
LockMethod · 0.65
UnlockMethod · 0.65

Tested by

no test coverage detected