Reduce wasted work in RemoveStatusService due to inactive followers (#7672)
This commit is contained in:
parent
7706ed038f
commit
461542784b
4 changed files with 17 additions and 6 deletions
|
@ -183,4 +183,15 @@ module AccountInteractions
|
|||
def pinned?(status)
|
||||
status_pins.where(status: status).exists?
|
||||
end
|
||||
|
||||
def followers_for_local_distribution
|
||||
followers.local
|
||||
.joins(:user)
|
||||
.where('users.current_sign_in_at > ?', User::ACTIVE_DURATION.ago)
|
||||
end
|
||||
|
||||
def lists_for_local_distribution
|
||||
lists.joins(account: :user)
|
||||
.where('users.current_sign_in_at > ?', User::ACTIVE_DURATION.ago)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue