mirror of
https://github.com/Evolix/chexpire.git
synced 2024-05-05 18:25:09 +02:00
Do not automatically mark as inactive checks for domain not found
This renders explicit the failures after X fails, and notify the user.
This commit is contained in:
parent
7a7ef4407b
commit
5d1fa13fba
|
@ -20,9 +20,6 @@ class WhoisSyncJob < ApplicationJob
|
||||||
return unless response.valid?
|
return unless response.valid?
|
||||||
|
|
||||||
update_from_response(response)
|
update_from_response(response)
|
||||||
rescue Whois::DomainNotFoundError
|
|
||||||
check.active = false
|
|
||||||
check.save!
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_from_response(response)
|
def update_from_response(response)
|
||||||
|
|
|
@ -60,7 +60,7 @@ class WhoisSyncJobTest < ActiveJob::TestCase
|
||||||
assert_equal 1, check.consecutive_failures
|
assert_equal 1, check.consecutive_failures
|
||||||
end
|
end
|
||||||
|
|
||||||
test "disable check when whois responds domain not found" do
|
test "increment consecutive failures when whois responds domain not found" do
|
||||||
domain = "willneverexist.fr"
|
domain = "willneverexist.fr"
|
||||||
check = create(:check, :nil_dates, domain: domain)
|
check = create(:check, :nil_dates, domain: domain)
|
||||||
|
|
||||||
|
@ -70,7 +70,6 @@ class WhoisSyncJobTest < ActiveJob::TestCase
|
||||||
|
|
||||||
check.reload
|
check.reload
|
||||||
|
|
||||||
refute check.active?
|
|
||||||
assert_just_now check.last_run_at
|
assert_just_now check.last_run_at
|
||||||
assert_nil check.last_success_at
|
assert_nil check.last_success_at
|
||||||
assert_equal 1, check.consecutive_failures
|
assert_equal 1, check.consecutive_failures
|
||||||
|
|
Loading…
Reference in a new issue