0
0
Fork 0

Add coverage for CLI::Feeds command (#25319)

This commit is contained in:
Matt Jankowski 2023-06-10 12:37:36 -04:00 committed by GitHub
parent 07933db788
commit b5675e265e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 63 additions and 1 deletions

View file

@ -19,7 +19,7 @@ module Mastodon::CLI
LONG_DESC
def build(username = nil)
if options[:all] || username.nil?
processed, = parallelize_with_progress(Account.joins(:user).merge(User.active)) do |account|
processed, = parallelize_with_progress(active_user_accounts) do |account|
PrecomputeFeedService.new.call(account) unless dry_run?
end
@ -47,5 +47,11 @@ module Mastodon::CLI
redis.del(keys)
say('OK', :green)
end
private
def active_user_accounts
Account.joins(:user).merge(User.active)
end
end
end