The code powering m.abunchtell.com https://m.abunchtell.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

21 lines
401 B

  1. # frozen_string_literal: true
  2. require 'sidekiq-scheduler'
  3. class Scheduler::SubscriptionsScheduler
  4. include Sidekiq::Worker
  5. def perform
  6. Rails.logger.debug 'Queueing PuSH re-subscriptions'
  7. expiring_accounts.pluck(:id) do |id|
  8. Pubsubhubbub::SubscribeWorker.perform_async(id)
  9. end
  10. end
  11. private
  12. def expiring_accounts
  13. Account.expiring(1.day.from_now).partitioned
  14. end
  15. end