Merge pull request #2025 from internetee/2024-fix-csync-crashes

Add error processing for nameservers in Csync job
This commit is contained in:
Timo Võhmar 2021-06-11 10:21:00 +03:00 committed by GitHub
commit 2f301bb4f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

View file

@ -48,9 +48,18 @@ class CsyncJob < ApplicationJob
scanner_results scanner_results
@results.keys.each do |domain| @results.keys.each do |domain|
next unless qualified_for_monitoring?(domain, @results[domain]) begin
next unless qualified_for_monitoring?(domain, @results[domain])
CsyncRecord.by_domain_name(domain)&.record_new_scan(@results[domain][:ns].first) CsyncRecord.by_domain_name(domain)&.record_new_scan(@results[domain][:ns].first)
rescue StandardError => e
error_message <<-ERROR
CsyncRecord error on domain #{domain}, nameserver #{@results[domain][:ns].first},
error: #{e}
ERROR
@logger.error error_message
next
end
end end
end end

View file

@ -655,7 +655,7 @@ class Domain < ApplicationRecord
end end
def update_whois_record def update_whois_record
UpdateWhoisRecordJob.perform_later name, 'domain' UpdateWhoisRecordJob.set(wait: 1.minute).perform_later name, 'domain'
end end
def status_notes_array=(notes) def status_notes_array=(notes)