Fix duplicate notifications being possible after poll expiration (#17697)
This commit is contained in:
parent
04c3ac896a
commit
2ea754b861
8 changed files with 13 additions and 11 deletions
|
@ -38,12 +38,14 @@ class PollExpirationNotifyWorker
|
|||
|
||||
def notify_remote_voters_and_owner!
|
||||
ActivityPub::DistributePollUpdateWorker.perform_async(@poll.status.id)
|
||||
NotifyService.new.call(@poll.account, :poll, @poll)
|
||||
LocalNotificationWorker.perform_async(@poll.account_id, @poll.id, 'Poll', 'poll')
|
||||
end
|
||||
|
||||
def notify_local_voters!
|
||||
@poll.voters.merge(Account.local).find_each do |account|
|
||||
NotifyService.new.call(account, :poll, @poll)
|
||||
@poll.voters.merge(Account.local).select(:id).find_in_batches do |accounts|
|
||||
LocalNotificationWorker.push_bulk(accounts) do |account|
|
||||
[account.id, @poll.id, 'Poll', 'poll']
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue