mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 16:32:46 +08:00
3c0e672fc4
This commit splits out the updating of `TopicUser#last_read_post_number` in `TopicUser.ensure_consistency!` to a new `TopicUser.update_last_read_post_number` method` which `PostTiming.pretend_read` will now call instead. Previously, `PostTiming.pretend_read` calls `TopicUser.ensure_consistency!` which in turn calls `TopicUser.update_post_action_cache` but that is unnecessary for `PostTiming.pretend_read` since `PostTiming.pretend_read` does not affect the `TopicUser#liked` or `TopicUser.bookmarked` columns which `TopicUser.update_post_action_cache` updates. As the query in `TopicUser.update_post_action_cache` can be expensive, we should avoid calling it when it isn't necessary. One such scenario where it is unnecessary is when we are closing a topic. |
||
---|---|---|
.. | ||
assets | ||
controllers | ||
helpers | ||
jobs | ||
mailers | ||
models | ||
serializers | ||
services | ||
views |