Fix store cache invalidation for reactions (#9331)
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
c8e473a789
Коммит
68fdaaa995
@@ -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 {
|
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...)
|
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 {
|
func (s *LocalCacheSupplier) ReactionDeleteAllWithEmojiName(ctx context.Context, emojiName string, hints ...LayeredStoreHint) *LayeredStoreSupplierResult {
|
||||||
// This could be improved. Right now we just clear the whole
|
// 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.
|
// 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...)
|
return s.Next().ReactionDeleteAllWithEmojiName(ctx, emojiName, hints...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user