From bb4d1eb2e86ec6227c18df29ce0f0f25ae2f6ee3 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 8 Nov 2016 02:08:32 +0100 Subject: Improve feed regeneration --- app/models/feed.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/models/feed.rb') diff --git a/app/models/feed.rb b/app/models/feed.rb index 211d64638..e7a39f5da 100644 --- a/app/models/feed.rb +++ b/app/models/feed.rb @@ -11,7 +11,8 @@ class Feed # If we're after most recent items and none are there, we need to precompute the feed if unhydrated.empty? && max_id == '+inf' && since_id == '-inf' - PrecomputeFeedService.new.call(@type, @account, limit) + RegenerationWorker.perform_async(@account.id, @type) + Status.send("as_#{@type}_timeline", @account).paginate_by_max_id(limit, nil, nil) else status_map = Status.where(id: unhydrated).with_includes.with_counters.map { |status| [status.id, status] }.to_h unhydrated.map { |id| status_map[id] }.compact -- cgit