diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-03-04 01:07:49 +0100 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2022-03-04 01:07:49 +0100 |
commit | d9c3109bb67f64c671573b1bab02132c6214509b (patch) | |
tree | 3d39c780306ee52a48b3c3d1ae30ecf600ba962d /app/workers | |
parent | 3637a0101e1f5095397f190e88f281d603797c32 (diff) | |
parent | 2ea754b8610b50cc93aeb1921ecdf7415efaf17e (diff) |
Merge branch 'main' into glitch-soc/merge-upstream
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/feed_insert_worker.rb | 2 | ||||
-rw-r--r-- | app/workers/poll_expiration_notify_worker.rb | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/app/workers/feed_insert_worker.rb b/app/workers/feed_insert_worker.rb index b81b09cac..9483510aa 100644 --- a/app/workers/feed_insert_worker.rb +++ b/app/workers/feed_insert_worker.rb @@ -74,7 +74,7 @@ class FeedInsertWorker end def perform_notify - NotifyService.new.call(@follower, :status, @status) + LocalNotificationWorker.perform_async(@follower.id, @status.id, 'Status', 'status') end def update? diff --git a/app/workers/poll_expiration_notify_worker.rb b/app/workers/poll_expiration_notify_worker.rb index 7613ed5f1..0e29a5f60 100644 --- a/app/workers/poll_expiration_notify_worker.rb +++ b/app/workers/poll_expiration_notify_worker.rb @@ -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 |