mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: TopicTrackingState calls should happen in the background (#11682)
* DEV: TopicTrackingState calls should happen in the background It was observed that calling TopicTrackingState on popular topics could result in a large number of calls to redis, resulting in slow response times when posting replies. These calls should be moved to a background job. * DEV: PostUpdateTopicTrackingState should execute on default queue
This commit is contained in:
@@ -57,12 +57,7 @@ class PostJobsEnqueuer
|
||||
end
|
||||
|
||||
def after_post_create
|
||||
TopicTrackingState.publish_unmuted(@post.topic)
|
||||
if @post.post_number > 1
|
||||
TopicTrackingState.publish_muted(@post.topic)
|
||||
TopicTrackingState.publish_unread(@post)
|
||||
end
|
||||
TopicTrackingState.publish_latest(@topic, @post.whisper?)
|
||||
Jobs.enqueue(:post_update_topic_tracking_state, post_id: @post.id)
|
||||
|
||||
Jobs.enqueue_in(SiteSetting.email_time_window_mins.minutes,
|
||||
:notify_mailing_list_subscribers,
|
||||
|
||||
Reference in New Issue
Block a user