Story#110308584 - fix merge conflicts in staging

This commit is contained in:
Vladimir Krylov 2016-08-26 11:32:11 +03:00
parent a217c3562f
commit bd3d99d741

View file

@ -95,11 +95,6 @@ class DomainCron
STDOUT << "#{Time.zone.now.utc} - Destroying domains\n" unless Rails.env.test? STDOUT << "#{Time.zone.now.utc} - Destroying domains\n" unless Rails.env.test?
c = 0 c = 0
Domain.where("statuses @> '{deleteCandidate}'::varchar[]").each do |x|
::PaperTrail.whodunnit = "cron - #{__method__} case statuses"
WhoisRecord.where(domain_id: x.id).destroy_all
destroy_with_message x
STDOUT << "#{Time.zone.now.utc} Domain.destroy_delete_candidates: by deleteCandidate ##{x.id} (#{x.name})\n" unless Rails.env.test?
Domain.where('delete_at <= ?', Time.zone.now.end_of_day.utc).each do |x| Domain.where('delete_at <= ?', Time.zone.now.end_of_day.utc).each do |x|
next unless x.delete_candidateable? next unless x.delete_candidateable?
@ -118,10 +113,6 @@ class DomainCron
Domain.where('force_delete_at <= ?', Time.zone.now.end_of_day.utc).each do |x| Domain.where('force_delete_at <= ?', Time.zone.now.end_of_day.utc).each do |x|
DomainDeleteJob.enqueue(x.id, run_at: rand(((24*60) - (DateTime.now.hour * 60 + DateTime.now.minute))).minutes.from_now) DomainDeleteJob.enqueue(x.id, run_at: rand(((24*60) - (DateTime.now.hour * 60 + DateTime.now.minute))).minutes.from_now)
STDOUT << "#{Time.zone.now.utc} DomainCron.destroy_delete_candidates: job added by force delete time ##{x.id} (#{x.name})\n" unless Rails.env.test? STDOUT << "#{Time.zone.now.utc} DomainCron.destroy_delete_candidates: job added by force delete time ##{x.id} (#{x.name})\n" unless Rails.env.test?
::PaperTrail.whodunnit = "cron - #{__method__} case force_deleted_at"
WhoisRecord.where(domain_id: x.id).destroy_all
destroy_with_message x
STDOUT << "#{Time.zone.now.utc} DomainCron.destroy_delete_candidates: by force delete time ##{x.id} (#{x.name})\n" unless Rails.env.test?
c += 1 c += 1
end end