From 7964bfccdb0bc30c4f15db092b66a6f8d57f1262 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sun, 23 Jul 2017 01:15:04 +0200 Subject: Add rake task mastodon:feeds:build to regenerate all active users' feeds (#4303) --- lib/tasks/mastodon.rake | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib') diff --git a/lib/tasks/mastodon.rake b/lib/tasks/mastodon.rake index bceeeaf01..edfa3a4ac 100644 --- a/lib/tasks/mastodon.rake +++ b/lib/tasks/mastodon.rake @@ -143,6 +143,13 @@ namespace :mastodon do task clear_all: :environment do Redis.current.keys('feed:*').each { |key| Redis.current.del(key) } end + + desc 'Generates home timelines for users who logged in in the past two weeks' + task build: :environment do + User.active.includes(:account).find_each do |u| + PrecomputeFeedService.new.call(u.account) + end + end end namespace :emails do -- cgit