diff options
author | Corey Hulen <corey@hulen.com> | 2016-12-08 07:18:15 -0800 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2016-12-08 10:18:15 -0500 |
commit | c4974374d9840caa6ec496c138a6220dd40afa54 (patch) | |
tree | c450cb63b76e032412f3e9c4433bae9518c89513 /store | |
parent | 7acd135e021de28bac61e65d5293be8a4f0df328 (diff) | |
download | chat-c4974374d9840caa6ec496c138a6220dd40afa54.tar.gz chat-c4974374d9840caa6ec496c138a6220dd40afa54.tar.bz2 chat-c4974374d9840caa6ec496c138a6220dd40afa54.zip |
PLT-4853 Adding cache purging to the server (server) (#4735)
* PLT-4853 Adding caching invalidation to HA
* PLT-4853 Adding cach purging to the server
Diffstat (limited to 'store')
-rw-r--r-- | store/sql_channel_store.go | 5 | ||||
-rw-r--r-- | store/sql_user_store.go | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/store/sql_channel_store.go b/store/sql_channel_store.go index e6b7b80bf..3ce672a68 100644 --- a/store/sql_channel_store.go +++ b/store/sql_channel_store.go @@ -33,6 +33,11 @@ type SqlChannelStore struct { var channelMemberCountsCache = utils.NewLru(CHANNEL_MEMBERS_COUNTS_CACHE_SIZE) var allChannelMembersForUserCache = utils.NewLru(ALL_CHANNEL_MEMBERS_FOR_USER_CACHE_SIZE) +func ClearChannelCaches() { + channelMemberCountsCache.Purge() + allChannelMembersForUserCache.Purge() +} + func NewSqlChannelStore(sqlStore *SqlStore) ChannelStore { s := &SqlChannelStore{sqlStore} diff --git a/store/sql_user_store.go b/store/sql_user_store.go index c8c6714d8..3fddfb77d 100644 --- a/store/sql_user_store.go +++ b/store/sql_user_store.go @@ -35,6 +35,10 @@ type SqlUserStore struct { var profilesInChannelCache *utils.Cache = utils.NewLru(PROFILES_IN_CHANNEL_CACHE_SIZE) +func ClearUserCaches() { + profilesInChannelCache.Purge() +} + func NewSqlUserStore(sqlStore *SqlStore) UserStore { us := &SqlUserStore{sqlStore} |