about summary refs log tree commit diff
path: root/app/workers/scheduler/subscriptions_scheduler.rb
blob: 469a3d2a62d9dcb4b06c61b9bf6a17e913dd40e7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

require 'sidekiq-scheduler'
require 'sidekiq-bulk'

class Scheduler::SubscriptionsScheduler
  include Sidekiq::Worker

  def perform
    Pubsubhubbub::SubscribeWorker.push_bulk(expiring_accounts.pluck(:id))
  end

  private

  def expiring_accounts
    Account.expiring(1.day.from_now).partitioned
  end
end