about summary refs log tree commit diff
path: root/app/lib/feed_manager.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/lib/feed_manager.rb')
-rw-r--r--app/lib/feed_manager.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/lib/feed_manager.rb b/app/lib/feed_manager.rb
index c2d3a2e2c..86928fa36 100644
--- a/app/lib/feed_manager.rb
+++ b/app/lib/feed_manager.rb
@@ -34,7 +34,7 @@ class FeedManager
       trim(timeline_type, account.id)
     end
 
-    PushUpdateWorker.perform_async(account.id, status.id)
+    PushUpdateWorker.perform_async(account.id, status.id) if push_update_required?(timeline_type, account.id)
   end
 
   def trim(type, account_id)
@@ -43,6 +43,10 @@ class FeedManager
     redis.zremrangebyscore(key(type, account_id), '-inf', "(#{last.last}")
   end
 
+  def push_update_required?(timeline_type, account_id)
+    timeline_type != :home || redis.get("subscribed:timeline:#{account_id}").present?
+  end
+
   def merge_into_timeline(from_account, into_account)
     timeline_key = key(:home, into_account.id)
     query        = from_account.statuses.limit(FeedManager::MAX_ITEMS / 4)