[COMPONENT][Posting] Clarify use of cache in note replies when posting

This commit is contained in:
Hugo Sales 2022-03-01 11:19:47 +00:00
parent 4cc4d06b11
commit a9a60bbd92
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0
1 changed files with 2 additions and 0 deletions

View File

@ -335,6 +335,8 @@ class Posting extends Component
// Update replies cache
if (!\is_null($reply_to_id)) {
Cache::incr(Note::cacheKeys($reply_to_id)['replies-count']);
// Not having them cached doesn't mean replies don't exist, but don't push it to the
// list, as that means they need to be refetched, or some would be missed
if (Cache::exists(Note::cacheKeys($reply_to_id)['replies'])) {
Cache::listPushRight(Note::cacheKeys($reply_to_id)['replies'], $note);
}