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