(entity params.ForgeEntity, err error)
| 84 | } |
| 85 | |
| 86 | func (g *GithubToolsCache) SetToolsError(entity params.ForgeEntity, err error) { |
| 87 | g.mux.Lock() |
| 88 | defer g.mux.Unlock() |
| 89 | |
| 90 | // If the entity is not in the cache, add it with the error. |
| 91 | cache, ok := g.entities[entity.ID] |
| 92 | if !ok { |
| 93 | g.entities[entity.ID] = GithubEntityTools{ |
| 94 | updatedAt: time.Now(), |
| 95 | entity: entity, |
| 96 | err: err, |
| 97 | } |
| 98 | return |
| 99 | } |
| 100 | |
| 101 | // Update the error for the existing entity. |
| 102 | cache.err = err |
| 103 | g.entities[entity.ID] = cache |
| 104 | } |
| 105 | |
| 106 | func (g *GithubToolsCache) Delete(entityID string) { |
| 107 | g.mux.Lock() |
no test coverage detected