(poolID string)
| 71 | } |
| 72 | |
| 73 | func (e *EntityCache) GetEntityForPool(poolID string) (params.ForgeEntity, bool) { |
| 74 | e.mux.Lock() |
| 75 | defer e.mux.Unlock() |
| 76 | |
| 77 | pool, ok := e.pools[poolID] |
| 78 | if !ok { |
| 79 | return params.ForgeEntity{}, false |
| 80 | } |
| 81 | |
| 82 | entity, err := pool.GetEntity() |
| 83 | if err != nil { |
| 84 | return params.ForgeEntity{}, false |
| 85 | } |
| 86 | if cacheEntity, ok := e.entities[entity.ID]; ok { |
| 87 | return cacheEntity.Entity, true |
| 88 | } |
| 89 | return params.ForgeEntity{}, false |
| 90 | } |
| 91 | |
| 92 | func (e *EntityCache) GetPoolByID(poolID string) (params.Pool, bool) { |
| 93 | e.mux.Lock() |
no test coverage detected