MM-22105: Revert "MM-21210: Add LRU cache for ChannelStore.GetMembersForUser (#13593)" (#13784)

This reverts commit 0361e8b97e.

The new cache ultimately did not give much benefit because the hit rate
was pretty low and it did not lead to any reduction in store timings.

So the increase in cluster messages was not worth it.

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Agniva De Sarker
2020-02-05 11:31:39 +05:30
коммит произвёл GitHub
родитель a986aeb401
Коммит bfaf4fa5dc
7 изменённых файлов: 27 добавлений и 303 удалений

18
services/cache/lru/lru.go поставляемый
Просмотреть файл

@@ -12,7 +12,6 @@ package lru
import (
"container/list"
"strings"
"sync"
"time"
@@ -188,23 +187,6 @@ func (c *Cache) Remove(key string) {
}
}
// RemoveByPrefix deletes all keys containing the given prefix string.
func (c *Cache) RemoveByPrefix(prefix string) {
c.lock.Lock()
defer c.lock.Unlock()
for ent := c.evictList.Back(); ent != nil; ent = ent.Prev() {
e := ent.Value.(*entry)
if e.generation == c.currentGeneration {
if strings.HasPrefix(e.key, prefix) {
if ent, ok := c.items[e.key]; ok {
c.removeElement(ent)
}
}
}
}
}
// Keys returns a slice of the keys in the cache, from oldest to newest.
func (c *Cache) Keys() []string {
c.lock.RLock()