Stop implements Cache.
()
| 207 | |
| 208 | // Stop implements Cache. |
| 209 | func (c *FifoCache) Stop() { |
| 210 | c.lock.Lock() |
| 211 | defer c.lock.Unlock() |
| 212 | |
| 213 | c.entriesEvicted.Add(float64(c.lru.Len())) |
| 214 | |
| 215 | c.entries = make(map[string]*list.Element) |
| 216 | c.lru.Init() |
| 217 | c.currSizeBytes = 0 |
| 218 | |
| 219 | c.entriesCurrent.Set(float64(0)) |
| 220 | c.memoryBytes.Set(float64(0)) |
| 221 | } |
| 222 | |
| 223 | func (c *FifoCache) put(key string, value []byte) { |
| 224 | // See if we already have the item in the cache. |