summaryrefslogtreecommitdiffstats
path: root/store
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2018-10-15 12:58:58 +0100
committerGitHub <noreply@github.com>2018-10-15 12:58:58 +0100
commit5726d3919d194ea07b2fb0672d6bfa0e2c5edf9e (patch)
treee4c41a486aab826b87bc91f7754dcf781c91993d /store
parent481d83a1e76415c7e64f2314a7d288ec1ae7aa4f (diff)
downloadchat-5726d3919d194ea07b2fb0672d6bfa0e2c5edf9e.tar.gz
chat-5726d3919d194ea07b2fb0672d6bfa0e2c5edf9e.tar.bz2
chat-5726d3919d194ea07b2fb0672d6bfa0e2c5edf9e.zip
MM-12419: Flush channels from cache when deleted/restored. (#9625)
Diffstat (limited to 'store')
-rw-r--r--store/sqlstore/channel_store.go2
-rw-r--r--store/sqlstore/channel_store_experimental.go2
2 files changed, 4 insertions, 0 deletions
diff --git a/store/sqlstore/channel_store.go b/store/sqlstore/channel_store.go
index 17ef6d4c9..63b9fbb42 100644
--- a/store/sqlstore/channel_store.go
+++ b/store/sqlstore/channel_store.go
@@ -660,6 +660,8 @@ func (s SqlChannelStore) Restore(channelId string, time int64) store.StoreChanne
// @see ChannelStoreExperimental for how this update propagates to the PublicChannels table.
func (s SqlChannelStore) SetDeleteAt(channelId string, deleteAt, updateAt int64) store.StoreChannel {
return store.Do(func(result *store.StoreResult) {
+ defer s.InvalidateChannel(channelId)
+
transaction, err := s.GetMaster().Begin()
if err != nil {
result.Err = model.NewAppError("SqlChannelStore.SetDeleteAt", "store.sql_channel.set_delete_at.open_transaction.app_error", nil, err.Error(), http.StatusInternalServerError)
diff --git a/store/sqlstore/channel_store_experimental.go b/store/sqlstore/channel_store_experimental.go
index aceb0c7c5..ed1b4c06a 100644
--- a/store/sqlstore/channel_store_experimental.go
+++ b/store/sqlstore/channel_store_experimental.go
@@ -283,6 +283,8 @@ func (s SqlChannelStoreExperimental) SetDeleteAt(channelId string, deleteAt, upd
}
return store.Do(func(result *store.StoreResult) {
+ defer s.InvalidateChannel(channelId)
+
transaction, err := s.GetMaster().Begin()
if err != nil {
result.Err = model.NewAppError("SqlChannelStoreExperimental.SetDeleteAt", "store.sql_channel.set_delete_at.open_transaction.app_error", nil, err.Error(), http.StatusInternalServerError)