From 68fdaaa995555e93f067efc3a07f1866e43ae665 Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Thu, 30 Aug 2018 13:25:25 -0400 Subject: Fix store cache invalidation for reactions (#9331) --- store/local_cache_supplier_reactions.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'store') diff --git a/store/local_cache_supplier_reactions.go b/store/local_cache_supplier_reactions.go index 2bf6b82d2..dd588e7c4 100644 --- a/store/local_cache_supplier_reactions.go +++ b/store/local_cache_supplier_reactions.go @@ -23,7 +23,7 @@ func (s *LocalCacheSupplier) ReactionSave(ctx context.Context, reaction *model.R } func (s *LocalCacheSupplier) ReactionDelete(ctx context.Context, reaction *model.Reaction, hints ...LayeredStoreHint) *LayeredStoreSupplierResult { - s.doInvalidateCacheCluster(s.reactionCache, reaction.PostId) + defer s.doInvalidateCacheCluster(s.reactionCache, reaction.PostId) return s.Next().ReactionDelete(ctx, reaction, hints...) } @@ -42,7 +42,7 @@ func (s *LocalCacheSupplier) ReactionGetForPost(ctx context.Context, postId stri func (s *LocalCacheSupplier) ReactionDeleteAllWithEmojiName(ctx context.Context, emojiName string, hints ...LayeredStoreHint) *LayeredStoreSupplierResult { // This could be improved. Right now we just clear the whole // cache because we don't have a way find what post Ids have this emoji name. - s.doClearCacheCluster(s.reactionCache) + defer s.doClearCacheCluster(s.reactionCache) return s.Next().ReactionDeleteAllWithEmojiName(ctx, emojiName, hints...) } -- cgit v1.2.3-1-g7c22