gab-social/app/workers/scheduler/expiring_pro_scheduler.rb
mgabdev 3cebbe30dc Updated retry count for ExpiringProScheduler, IntroduceProScheduler
• Updated:
- retry count for ExpiringProScheduler, IntroduceProScheduler
2020-10-16 16:25:58 -05:00

19 lines
403 B
Ruby

# frozen_string_literal: true
class Scheduler::ExpiringProScheduler
include Sidekiq::Worker
sidekiq_options queue: 'mailers', retry: 12
def perform
expired_accounts.find_each do |acct|
ExpireAccountProWorker.perform_async(acct.id)
end
end
private
def expired_accounts
Account.where('is_pro=TRUE AND pro_expires_at BETWEEN ? AND ?', 1.day.ago, Time.now.utc)
end
end