New table "post-counts" to precalculate the counts

This commit is contained in:
Michael
2023-12-28 17:42:39 +00:00
parent 2588ac1a16
commit 40a1263066
9 changed files with 222 additions and 4 deletions

View File

@@ -1432,6 +1432,10 @@ class Item
self::updateDisplayCache($posted_item['uri-id']);
}
if (in_array($posted_item['gravity'], [self::GRAVITY_ACTIVITY, self::GRAVITY_COMMENT]) && ($posted_item['uid'] == 0)) {
Post\Counts::update($posted_item['thr-parent-id'], $posted_item['parent-uri-id'], $posted_item['vid'], $posted_item['verb'], $posted_item['body']);
}
if ($inserted) {
Post\Engagement::storeFromItem($posted_item);
}