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
Этот коммит содержится в:
Corey Hulen
2016-12-08 07:18:15 -08:00
коммит произвёл Harrison Healey
родитель 7acd135e02
Коммит c4974374d9
12 изменённых файлов: 76 добавлений и 10 удалений

Просмотреть файл

@@ -17,6 +17,7 @@ import (
"github.com/mattermost/platform/einterfaces"
"github.com/mattermost/platform/model"
"github.com/mattermost/platform/store"
"github.com/mattermost/platform/utils"
)
@@ -514,3 +515,11 @@ func RemoveAllSessionsForUserIdSkipClusterSend(userId string) {
func AddSessionToCache(session *model.Session) {
sessionCache.AddWithExpiresInSecs(session.Token, session, int64(*utils.Cfg.ServiceSettings.SessionCacheInMinutes*60))
}
func InvalidateAllCaches() {
l4g.Info(utils.T("api.context.invalidate_all_caches"))
sessionCache.Purge()
ClearStatusCache()
store.ClearChannelCaches()
store.ClearUserCaches()
}