mirror of
https://github.com/internetee/registry.git
synced 2025-08-12 20:49:36 +02:00
107997032-whois_domain_delete
This commit is contained in:
parent
96e599f885
commit
18517fd10c
1 changed files with 2 additions and 0 deletions
|
@ -301,12 +301,14 @@ class Domain < ActiveRecord::Base
|
||||||
|
|
||||||
c = 0
|
c = 0
|
||||||
Domain.where("statuses @> '{deleteCandidate}'::varchar[]").each do |x|
|
Domain.where("statuses @> '{deleteCandidate}'::varchar[]").each do |x|
|
||||||
|
Whois::Record.where('domain_id = ?', x.id).try(':destroy')
|
||||||
x.destroy
|
x.destroy
|
||||||
STDOUT << "#{Time.zone.now.utc} Domain.destroy_delete_candidates: by deleteCandidate ##{x.id} (#{x.name})\n" unless Rails.env.test?
|
STDOUT << "#{Time.zone.now.utc} Domain.destroy_delete_candidates: by deleteCandidate ##{x.id} (#{x.name})\n" unless Rails.env.test?
|
||||||
c += 1
|
c += 1
|
||||||
end
|
end
|
||||||
|
|
||||||
Domain.where('force_delete_at <= ?', Time.zone.now).each do |x|
|
Domain.where('force_delete_at <= ?', Time.zone.now).each do |x|
|
||||||
|
Whois::Record.where('domain_id = ?', x.id).try(':destroy')
|
||||||
x.destroy
|
x.destroy
|
||||||
STDOUT << "#{Time.zone.now.utc} Domain.destroy_delete_candidates: by force delete time ##{x.id} (#{x.name})\n" unless Rails.env.test?
|
STDOUT << "#{Time.zone.now.utc} Domain.destroy_delete_candidates: by force delete time ##{x.id} (#{x.name})\n" unless Rails.env.test?
|
||||||
c += 1
|
c += 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue