logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

raw_distribution_worker.rb (525B)


  1. # frozen_string_literal: true
  2. class Pubsubhubbub::RawDistributionWorker
  3. include Sidekiq::Worker
  4. sidekiq_options queue: 'push'
  5. def perform(xml, source_account_id)
  6. @account = Account.find(source_account_id)
  7. @subscriptions = active_subscriptions.to_a
  8. Pubsubhubbub::DeliveryWorker.push_bulk(@subscriptions) do |subscription|
  9. [subscription.id, xml]
  10. end
  11. end
  12. private
  13. def active_subscriptions
  14. Subscription.where(account: @account).active.select('id, callback_url, domain')
  15. end
  16. end