logo

mastofe

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

subscriptions_scheduler.rb (339B)


  1. # frozen_string_literal: true
  2. require 'sidekiq-scheduler'
  3. require 'sidekiq-bulk'
  4. class Scheduler::SubscriptionsScheduler
  5. include Sidekiq::Worker
  6. def perform
  7. Pubsubhubbub::SubscribeWorker.push_bulk(expiring_accounts.pluck(:id))
  8. end
  9. private
  10. def expiring_accounts
  11. Account.expiring(1.day.from_now).partitioned
  12. end
  13. end