summaryrefslogtreecommitdiffstats
path: root/store/sql_channel_store.go
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2017-02-17 08:21:06 -0500
committerJoram Wilander <jwawilander@gmail.com>2017-02-17 08:21:06 -0500
commit26e44d9b32948693a035bea5cb31134526e01fe3 (patch)
treea7b218ecb6548c2af25de4f2f8b13260a86aac6c /store/sql_channel_store.go
parentda448cedc8329246e0a4bf027c161dcd15d29a36 (diff)
downloadchat-26e44d9b32948693a035bea5cb31134526e01fe3.tar.gz
chat-26e44d9b32948693a035bea5cb31134526e01fe3.tar.bz2
chat-26e44d9b32948693a035bea5cb31134526e01fe3.zip
Bumping base cache numbers for master (#5451)
Diffstat (limited to 'store/sql_channel_store.go')
-rw-r--r--store/sql_channel_store.go13
1 files changed, 6 insertions, 7 deletions
diff --git a/store/sql_channel_store.go b/store/sql_channel_store.go
index dfc77bd8a..503b646f6 100644
--- a/store/sql_channel_store.go
+++ b/store/sql_channel_store.go
@@ -25,11 +25,10 @@ const (
ALL_CHANNEL_MEMBERS_FOR_USER_CACHE_SIZE = model.SESSION_CACHE_SIZE
ALL_CHANNEL_MEMBERS_FOR_USER_CACHE_SEC = 900 // 15 mins
- CHANNEL_MEMBERS_COUNTS_CACHE_SIZE = 20000
- CHANNEL_MEMBERS_COUNTS_CACHE_SEC = 900 // 15 mins
+ CHANNEL_MEMBERS_COUNTS_CACHE_SIZE = model.CHANNEL_CACHE_SIZE
+ CHANNEL_MEMBERS_COUNTS_CACHE_SEC = 1800 // 30 mins
- CHANNEL_CACHE_SIZE = 5000
- CHANNEL_CACHE_SEC = 900 // 15 mins
+ CHANNEL_CACHE_SEC = 900 // 15 mins
)
type SqlChannelStore struct {
@@ -38,8 +37,8 @@ type SqlChannelStore struct {
var channelMemberCountsCache = utils.NewLru(CHANNEL_MEMBERS_COUNTS_CACHE_SIZE)
var allChannelMembersForUserCache = utils.NewLru(ALL_CHANNEL_MEMBERS_FOR_USER_CACHE_SIZE)
-var channelCache = utils.NewLru(CHANNEL_CACHE_SIZE)
-var channelByNameCache = utils.NewLru(CHANNEL_CACHE_SIZE)
+var channelCache = utils.NewLru(model.CHANNEL_CACHE_SIZE)
+var channelByNameCache = utils.NewLru(model.CHANNEL_CACHE_SIZE)
func ClearChannelCaches() {
channelMemberCountsCache.Purge()
@@ -361,7 +360,7 @@ func (s SqlChannelStore) get(id string, master bool, allowFromCache bool) StoreC
result.Err = model.NewLocAppError("SqlChannelStore.Get", "store.sql_channel.get.existing.app_error", nil, "id="+id)
} else {
result.Data = obj.(*model.Channel)
- channelCache.AddWithExpiresInSecs(id, obj.(*model.Channel), CHANNEL_MEMBERS_COUNTS_CACHE_SEC)
+ channelCache.AddWithExpiresInSecs(id, obj.(*model.Channel), CHANNEL_CACHE_SEC)
}
storeChannel <- result