From 14f6771e77fb3fa2bdba5eb25b9688069f2a08b5 Mon Sep 17 00:00:00 2001 From: robcolbert Date: Mon, 8 Jul 2019 06:02:42 -0400 Subject: [PATCH] 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. --- app/lib/feed_manager.rb | 4 ++-- app/workers/push_update_worker.rb | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/lib/feed_manager.rb b/app/lib/feed_manager.rb index c903f9d1..02e9cb64 100644 --- a/app/lib/feed_manager.rb +++ b/app/lib/feed_manager.rb @@ -30,7 +30,7 @@ class FeedManager def push_to_home(account, status) return false unless add_to_feed(:home, account.id, status, account.user&.aggregates_reblogs?) 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 end @@ -48,7 +48,7 @@ class FeedManager end return false unless add_to_feed(:list, list.id, status, list.account.user&.aggregates_reblogs?) 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 end diff --git a/app/workers/push_update_worker.rb b/app/workers/push_update_worker.rb index d76d73d9..6ed4906b 100644 --- a/app/workers/push_update_worker.rb +++ b/app/workers/push_update_worker.rb @@ -9,7 +9,8 @@ class PushUpdateWorker message = InlineRenderer.render(status, account, :status) 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 true end