Fix: アンテナに登録された投稿がアンテナ削除時Redisから削除されない問題 (#417)
* Fix: アンテナに登録された投稿がRedisから削除されない問題 * Fix test * Tootctlに変更 * 処理を共通化
This commit is contained in:
parent
e227885d0b
commit
06123147d5
5 changed files with 292 additions and 0 deletions
|
@ -4,6 +4,7 @@ class Vacuum::FeedsVacuum
|
|||
def perform
|
||||
vacuum_inactive_home_feeds!
|
||||
vacuum_inactive_list_feeds!
|
||||
vacuum_inactive_antenna_feeds!
|
||||
end
|
||||
|
||||
private
|
||||
|
@ -20,6 +21,12 @@ class Vacuum::FeedsVacuum
|
|||
end
|
||||
end
|
||||
|
||||
def vacuum_inactive_antenna_feeds!
|
||||
inactive_users_antennas.select(:id).in_batches do |antennas|
|
||||
feed_manager.clean_feeds!(:antenna, antennas.ids)
|
||||
end
|
||||
end
|
||||
|
||||
def inactive_users
|
||||
User.confirmed.inactive
|
||||
end
|
||||
|
@ -28,6 +35,10 @@ class Vacuum::FeedsVacuum
|
|||
List.where(account_id: inactive_users.select(:account_id))
|
||||
end
|
||||
|
||||
def inactive_users_antennas
|
||||
Antenna.where(account_id: inactive_users.select(:account_id))
|
||||
end
|
||||
|
||||
def feed_manager
|
||||
FeedManager.instance
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue