This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
2017-05-04 17:23:01 -07:00
|
|
|
# frozen_string_literal: true
|
2017-06-03 15:11:15 -07:00
|
|
|
|
2017-05-04 17:23:01 -07:00
|
|
|
class Scheduler::SubscriptionsScheduler
|
|
|
|
include Sidekiq::Worker
|
|
|
|
|
2018-08-25 04:28:07 -07:00
|
|
|
sidekiq_options unique: :until_executed, retry: 0
|
2018-08-19 06:48:29 -07:00
|
|
|
|
2017-05-04 17:23:01 -07:00
|
|
|
def perform
|
2017-06-03 15:11:15 -07:00
|
|
|
Pubsubhubbub::SubscribeWorker.push_bulk(expiring_accounts.pluck(:id))
|
2017-05-04 17:23:01 -07:00
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def expiring_accounts
|
2017-08-20 16:14:40 -07:00
|
|
|
Account.expiring(1.day.from_now).partitioned
|
2017-05-04 17:23:01 -07:00
|
|
|
end
|
|
|
|
end
|