| 145 | } |
| 146 | |
| 147 | func (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 | |
| 165 | func (e *EntityCache) ReplaceEntityPools(entityID string, pools []params.Pool) { |
| 166 | e.mux.Lock() |