fix(push-subscriptions): Refactor how Sidekiq jobs are handled (#4226)
This commit is contained in:
parent
afa52e4d63
commit
8387b3928e
3 changed files with 19 additions and 17 deletions
|
@ -65,7 +65,11 @@ class NotifyService < BaseService
|
|||
end
|
||||
|
||||
def send_push_notifications
|
||||
WebPushNotificationWorker.perform_async(@recipient.id, @notification.id)
|
||||
sessions_with_subscriptions_ids = @recipient.user.session_activations.where.not(web_push_subscription: nil).pluck(:id)
|
||||
|
||||
WebPushNotificationWorker.push_bulk(sessions_with_subscriptions_ids) do |session_activation_id|
|
||||
[session_activation_id, @notification.id]
|
||||
end
|
||||
end
|
||||
|
||||
def send_email
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue