mirror of
https://github.com/internetee/registry.git
synced 2025-06-07 05:05:45 +02:00
Remove unused CRON tasks
This commit is contained in:
parent
cee51e1ac5
commit
9059779ece
4 changed files with 0 additions and 52 deletions
1
.reek
1
.reek
|
@ -290,7 +290,6 @@ DuplicateMethodCall:
|
|||
- Domain#renewable?
|
||||
- Domain#set_graceful_expired
|
||||
- DomainCron#self.clean_expired_pendings
|
||||
- DomainCron#self.delete_legal_doc_duplicates
|
||||
- DomainCron#self.destroy_delete_candidates
|
||||
- DomainCron#self.start_expire_period
|
||||
- DomainCron#self.start_redemption_grace_period
|
||||
|
|
|
@ -209,11 +209,6 @@ class Domain < ActiveRecord::Base
|
|||
DomainCron.send(__method__)
|
||||
end
|
||||
|
||||
def self.start_delete_period
|
||||
ActiveSupport::Deprecation.instance.deprecation_warning(DomainCron, __method__)
|
||||
DomainCron.send(__method__)
|
||||
end
|
||||
|
||||
def self.destroy_delete_candidates
|
||||
ActiveSupport::Deprecation.instance.deprecation_warning(DomainCron, __method__)
|
||||
DomainCron.send(__method__)
|
||||
|
|
|
@ -76,29 +76,6 @@ class DomainCron
|
|||
marked
|
||||
end
|
||||
|
||||
#doing nothing, deprecated
|
||||
|
||||
def self.start_delete_period
|
||||
# begin
|
||||
# STDOUT << "#{Time.zone.now.utc} - Setting delete_candidate to domains\n" unless Rails.env.test?
|
||||
#
|
||||
# d = Domain.where('delete_at <= ?', Time.zone.now)
|
||||
# marked = 0
|
||||
# real = 0
|
||||
# d.each do |domain|
|
||||
# next unless domain.delete_candidateable?
|
||||
# real += 1
|
||||
# domain.statuses << DomainStatus::DELETE_CANDIDATE
|
||||
# STDOUT << "#{Time.zone.now.utc} DomainCron.start_delete_period: ##{domain.id} (#{domain.name})\n" unless Rails.env.test?
|
||||
# ::PaperTrail.whodunnit = "cron - #{__method__}"
|
||||
# domain.save(validate: false) and marked += 1
|
||||
# end
|
||||
# ensure # the operator should see what was accomplished
|
||||
# STDOUT << "#{Time.zone.now.utc} - Finished setting delete_candidate - #{marked} out of #{real} successfully set\n" unless Rails.env.test?
|
||||
# end
|
||||
# marked
|
||||
end
|
||||
|
||||
def self.destroy_delete_candidates
|
||||
STDOUT << "#{Time.zone.now.utc} - Destroying domains\n" unless Rails.env.test?
|
||||
|
||||
|
@ -128,23 +105,4 @@ class DomainCron
|
|||
|
||||
STDOUT << "#{Time.zone.now.utc} - Job destroy added for #{c} domains\n" unless Rails.env.test?
|
||||
end
|
||||
|
||||
# rubocop: enable Metrics/AbcSize
|
||||
# rubocop:enable Rails/FindEach
|
||||
# rubocop: enable Metrics/LineLength
|
||||
def self.destroy_with_message(domain)
|
||||
domain.destroy
|
||||
bye_bye = domain.versions.last
|
||||
domain.registrar.messages.create!(
|
||||
body: "#{I18n.t(:domain_deleted)}: #{domain.name}",
|
||||
attached_obj_id: bye_bye.id,
|
||||
attached_obj_type: bye_bye.class.to_s # DomainVersion
|
||||
)
|
||||
end
|
||||
|
||||
def self.delete_legal_doc_duplicates
|
||||
Rake::Task['legal_doc:remove_duplicates'].reenable
|
||||
Rake::Task['legal_doc:remove_duplicates'].invoke
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -46,10 +46,6 @@ if @cron_group == 'registry'
|
|||
runner 'DomainCron.start_expire_period'
|
||||
end
|
||||
|
||||
every 50.minutes do
|
||||
runner 'DomainCron.start_delete_period'
|
||||
end
|
||||
|
||||
every 52.minutes do
|
||||
runner 'DomainCron.start_redemption_grace_period'
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue