mirror of
https://github.com/internetee/registry.git
synced 2025-07-01 16:53:37 +02:00
Merge pull request #168 from internetee/113430903-delete_candidate_randomizer
113430903-delete_time_changed
This commit is contained in:
commit
a217c3562f
1 changed files with 2 additions and 2 deletions
|
@ -101,7 +101,7 @@ class DomainCron
|
|||
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).each do |x|
|
||||
Domain.where('delete_at <= ?', Time.zone.now.end_of_day.utc).each do |x|
|
||||
next unless x.delete_candidateable?
|
||||
|
||||
x.statuses << DomainStatus::DELETE_CANDIDATE
|
||||
|
@ -115,7 +115,7 @@ class DomainCron
|
|||
end
|
||||
end
|
||||
|
||||
Domain.where('force_delete_at <= ?', Time.zone.now).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)
|
||||
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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue