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

Method SetEntity

cache/entity_cache.go:147–163  ·  view source on GitHub ↗
(entity params.ForgeEntity)

Source from the content-addressed store, hash-verified

145}
146
147func (e *EntityCache) SetEntity(entity params.ForgeEntity) {
148 e.mux.Lock()
149 defer e.mux.Unlock()
150
151 cache, ok := e.entities[entity.ID]
152 if !ok {
153 e.entities[entity.ID] = EntityItem{
154 Entity: entity,
155 Pools: make(map[string]struct{}),
156 ScaleSets: make(map[uint]struct{}),
157 RunnerGroups: make(map[string]RunnerGroupEntry),
158 }
159 return
160 }
161 cache.Entity = entity
162 e.entities[entity.ID] = cache
163}
164
165func (e *EntityCache) ReplaceEntityPools(entityID string, pools []params.Pool) {
166 e.mux.Lock()

Callers 1

SetEntityFunction · 0.80

Calls 2

LockMethod · 0.65
UnlockMethod · 0.65

Tested by

no test coverage detected