闭社主体 forked from https://github.com/tootsuite/mastodon
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.

18 lines
339 B

  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