Add instance cache
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
parent
9f640965e2
commit
2f3c74562e
6 changed files with 171 additions and 46 deletions
10
cache/entity_cache.go
vendored
10
cache/entity_cache.go
vendored
|
|
@ -49,6 +49,16 @@ func (e *EntityCache) SetEntity(entity params.GithubEntity) {
|
|||
e.mux.Lock()
|
||||
defer e.mux.Unlock()
|
||||
|
||||
_, ok := e.entities[entity.ID]
|
||||
if !ok {
|
||||
e.entities[entity.ID] = EntityItem{
|
||||
Entity: entity,
|
||||
Pools: make(map[string]params.Pool),
|
||||
ScaleSets: make(map[uint]params.ScaleSet),
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
e.entities[entity.ID] = EntityItem{
|
||||
Entity: entity,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue