for now, stop sending push updates to clients (auto-scroll timelines)

One of the biggest complaints received at launch was the update speed of
the home timeline. This change disables the jobs and signals that
trigger the update to get pushed without altering other logic.
This commit is contained in:
robcolbert 2019-07-08 06:02:42 -04:00
parent 1d6a82fade
commit 14f6771e77
2 changed files with 4 additions and 3 deletions

View File

@ -30,7 +30,7 @@ class FeedManager
def push_to_home(account, status) def push_to_home(account, status)
return false unless add_to_feed(:home, account.id, status, account.user&.aggregates_reblogs?) return false unless add_to_feed(:home, account.id, status, account.user&.aggregates_reblogs?)
trim(:home, account.id) trim(:home, account.id)
PushUpdateWorker.perform_async(account.id, status.id, "timeline:#{account.id}") if push_update_required?("timeline:#{account.id}") #PushUpdateWorker.perform_async(account.id, status.id, "timeline:#{account.id}") if push_update_required?("timeline:#{account.id}")
true true
end end
@ -48,7 +48,7 @@ class FeedManager
end end
return false unless add_to_feed(:list, list.id, status, list.account.user&.aggregates_reblogs?) return false unless add_to_feed(:list, list.id, status, list.account.user&.aggregates_reblogs?)
trim(:list, list.id) trim(:list, list.id)
PushUpdateWorker.perform_async(list.account_id, status.id, "timeline:list:#{list.id}") if push_update_required?("timeline:list:#{list.id}") #PushUpdateWorker.perform_async(list.account_id, status.id, "timeline:list:#{list.id}") if push_update_required?("timeline:list:#{list.id}")
true true
end end

View File

@ -9,7 +9,8 @@ class PushUpdateWorker
message = InlineRenderer.render(status, account, :status) message = InlineRenderer.render(status, account, :status)
timeline_id = "timeline:#{account.id}" if timeline_id.nil? timeline_id = "timeline:#{account.id}" if timeline_id.nil?
Redis.current.publish(timeline_id, Oj.dump(event: :update, payload: message, queued_at: (Time.now.to_f * 1000.0).to_i)) # Redis.current.publish(timeline_id, Oj.dump(event: :update, payload: message, queued_at: (Time.now.to_f * 1000.0).to_i))
true
rescue ActiveRecord::RecordNotFound rescue ActiveRecord::RecordNotFound
true true
end end