mirror of
https://github.com/internetee/registry.git
synced 2025-08-12 04:29:33 +02:00
added cleaner for disputed domains with the closed disputed
This commit is contained in:
parent
f5283ba7a4
commit
4c8b345ecf
1 changed files with 8 additions and 0 deletions
|
@ -8,6 +8,7 @@ class DisputeStatusUpdateJob < ApplicationJob
|
||||||
|
|
||||||
close_disputes
|
close_disputes
|
||||||
activate_disputes
|
activate_disputes
|
||||||
|
clean_disputed
|
||||||
|
|
||||||
@logger.info "DisputeStatusUpdateJob - All done. Closed #{@backlog['closed']} and " \
|
@logger.info "DisputeStatusUpdateJob - All done. Closed #{@backlog['closed']} and " \
|
||||||
"activated #{@backlog['activated']} disputes."
|
"activated #{@backlog['activated']} disputes."
|
||||||
|
@ -15,6 +16,13 @@ class DisputeStatusUpdateJob < ApplicationJob
|
||||||
show_failed_disputes unless @backlog['activate_fail'].empty? && @backlog['close_fail'].empty?
|
show_failed_disputes unless @backlog['activate_fail'].empty? && @backlog['close_fail'].empty?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def clean_disputed
|
||||||
|
domains = Domain.where("array_to_string(statuses, '||') ILIKE ?", '%disputed%')
|
||||||
|
domains.each do |domain|
|
||||||
|
domain.unmark_as_disputed unless domain.disputed?
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def close_disputes
|
def close_disputes
|
||||||
disputes = if @include_closed
|
disputes = if @include_closed
|
||||||
Dispute.where('expires_at < ?', Time.zone.today).all
|
Dispute.where('expires_at < ?', Time.zone.today).all
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue