summaryrefslogtreecommitdiffstats
path: root/store/sql_channel_store.go
diff options
context:
space:
mode:
Diffstat (limited to 'store/sql_channel_store.go')
-rw-r--r--store/sql_channel_store.go34
1 files changed, 1 insertions, 33 deletions
diff --git a/store/sql_channel_store.go b/store/sql_channel_store.go
index 068692074..ea32317a3 100644
--- a/store/sql_channel_store.go
+++ b/store/sql_channel_store.go
@@ -28,9 +28,6 @@ const (
ALL_CHANNEL_MEMBERS_NOTIFY_PROPS_FOR_CHANNEL_CACHE_SIZE = model.SESSION_CACHE_SIZE
ALL_CHANNEL_MEMBERS_NOTIFY_PROPS_FOR_CHANNEL_CACHE_SEC = 1800 // 30 mins
- CHANNEL_MEMBER_CACHE_SIZE = model.SESSION_CACHE_SIZE
- CHANNEL_MEMBER_CACHE_SEC = 900 // 15 mins
-
CHANNEL_MEMBERS_COUNTS_CACHE_SIZE = model.CHANNEL_CACHE_SIZE
CHANNEL_MEMBERS_COUNTS_CACHE_SEC = 1800 // 30 mins
@@ -46,7 +43,6 @@ var allChannelMembersForUserCache = utils.NewLru(ALL_CHANNEL_MEMBERS_FOR_USER_CA
var allChannelMembersNotifyPropsForChannelCache = utils.NewLru(ALL_CHANNEL_MEMBERS_NOTIFY_PROPS_FOR_CHANNEL_CACHE_SIZE)
var channelCache = utils.NewLru(model.CHANNEL_CACHE_SIZE)
var channelByNameCache = utils.NewLru(model.CHANNEL_CACHE_SIZE)
-var channelMemberCache = utils.NewLru(CHANNEL_MEMBER_CACHE_SIZE)
func ClearChannelCaches() {
channelMemberCountsCache.Purge()
@@ -54,7 +50,6 @@ func ClearChannelCaches() {
allChannelMembersNotifyPropsForChannelCache.Purge()
channelCache.Purge()
channelByNameCache.Purge()
- channelMemberCache.Purge()
}
func NewSqlChannelStore(sqlStore *SqlStore) ChannelStore {
@@ -781,36 +776,11 @@ func (s SqlChannelStore) GetMembers(channelId string, offset, limit int) StoreCh
return storeChannel
}
-func (s SqlChannelStore) InvalidateMember(channelId string, userId string) {
- channelMemberCache.Remove(channelId + userId)
-}
-
-func (s SqlChannelStore) GetMember(channelId string, userId string, allowFromCache bool) StoreChannel {
+func (s SqlChannelStore) GetMember(channelId string, userId string) StoreChannel {
storeChannel := make(StoreChannel, 1)
go func() {
result := StoreResult{}
- metrics := einterfaces.GetMetricsInterface()
-
- if allowFromCache {
- if cacheItem, ok := channelMemberCache.Get(channelId + userId); ok {
- if metrics != nil {
- metrics.IncrementMemCacheHitCounter("Channel Member")
- }
- result.Data = cacheItem.(*model.ChannelMember)
- storeChannel <- result
- close(storeChannel)
- return
- } else {
- if metrics != nil {
- metrics.IncrementMemCacheMissCounter("Channel Member")
- }
- }
- } else {
- if metrics != nil {
- metrics.IncrementMemCacheMissCounter("Channel Member")
- }
- }
var member model.ChannelMember
@@ -822,8 +792,6 @@ func (s SqlChannelStore) GetMember(channelId string, userId string, allowFromCac
}
} else {
result.Data = &member
-
- channelMemberCache.AddWithExpiresInSecs(channelId+userId, &member, CHANNEL_MEMBER_CACHE_SEC)
}
storeChannel <- result