mirror of
https://github.com/internetee/registry.git
synced 2025-06-09 22:24:47 +02:00
Move #redemption_grace_period to interactor
This commit is contained in:
parent
849010b118
commit
d17e26c28b
4 changed files with 51 additions and 18 deletions
|
@ -8,24 +8,7 @@ class DomainCron
|
|||
end
|
||||
|
||||
def self.start_redemption_grace_period
|
||||
STDOUT << "#{Time.zone.now.utc} - Setting server_hold to domains\n" unless Rails.env.test?
|
||||
|
||||
::PaperTrail.request.whodunnit = "cron - #{__method__}"
|
||||
|
||||
domains = Domain.outzone_candidates
|
||||
marked = 0
|
||||
real = 0
|
||||
|
||||
domains.each do |domain|
|
||||
next unless domain.server_holdable?
|
||||
real += 1
|
||||
domain.statuses << DomainStatus::SERVER_HOLD
|
||||
STDOUT << "#{Time.zone.now.utc} DomainCron.start_redemption_grace_period: ##{domain.id} (#{domain.name}) #{domain.changes}\n" unless Rails.env.test?
|
||||
domain.save(validate: false) and marked += 1
|
||||
end
|
||||
|
||||
STDOUT << "#{Time.zone.now.utc} - Successfully set server_hold to #{marked} of #{real} domains\n" unless Rails.env.test?
|
||||
marked
|
||||
Domains::RedemptionGracePeriod::Start.run!
|
||||
end
|
||||
|
||||
def self.start_client_hold
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue