From af5f66f1de1d208adb8ae5c41e32ad70fabf0b75 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Tue, 8 Jun 2021 14:59:34 +0500 Subject: [PATCH 1/4] Add error processing for nameservers in Csync job --- app/jobs/csync_job.rb | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app/jobs/csync_job.rb b/app/jobs/csync_job.rb index 99b96fa74..fe8dd4196 100644 --- a/app/jobs/csync_job.rb +++ b/app/jobs/csync_job.rb @@ -48,9 +48,18 @@ class CsyncJob < ApplicationJob scanner_results @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 From f985250937c1ac555c9d28ac8b5f9cdcf025f3fb Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Wed, 9 Jun 2021 13:47:59 +0500 Subject: [PATCH 2/4] Added 1 minute pause before updating whois --- app/models/domain.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/domain.rb b/app/models/domain.rb index 9afde0891..83e9044fe 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -655,7 +655,7 @@ class Domain < ApplicationRecord end def update_whois_record - UpdateWhoisRecordJob.perform_later name, 'domain' + UpdateWhoisRecordJob.set(wait: 1.minute).perform_later name, 'domain' end def status_notes_array=(notes) From 0bb713de54e073687a6023e9213982418ee4e5c1 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Thu, 10 Jun 2021 12:15:36 +0500 Subject: [PATCH 3/4] Add local gem --- Gemfile | 1 + Gemfile.lock | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 5bcbd2bec..51089b868 100644 --- a/Gemfile +++ b/Gemfile @@ -10,6 +10,7 @@ gem 'mimemagic', '0.4.3' gem 'rails', '~> 6.1.3.2' gem 'rest-client' gem 'uglifier' +gem 'shunter', path: '/shared/shunter/' # load env gem 'figaro', '~> 1.2' diff --git a/Gemfile.lock b/Gemfile.lock index 40b77456d..cff5aea99 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -73,6 +73,12 @@ GIT nokogiri (>= 1.4.0) savon (>= 2.4.0) +PATH + remote: /shared/shunter + specs: + shunter (0.1.0) + redis (~> 4.2) + GEM remote: https://rubygems.org/ specs: @@ -565,6 +571,7 @@ DEPENDENCIES sass-rails select2-rails (= 4.0.13) selectize-rails (= 0.12.6) + shunter! sidekiq simplecov (= 0.17.1) simpleidn (= 0.2.1) @@ -577,4 +584,4 @@ DEPENDENCIES wkhtmltopdf-binary (~> 0.12.5.1) BUNDLED WITH - 2.2.17 + 2.2.19 From 074bad8bdec603ec760ccc967e61bcd52f3f4523 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Thu, 10 Jun 2021 12:16:20 +0500 Subject: [PATCH 4/4] Revert "Add local gem" This reverts commit 0bb713de54e073687a6023e9213982418ee4e5c1. --- Gemfile | 1 - Gemfile.lock | 9 +-------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/Gemfile b/Gemfile index 51089b868..5bcbd2bec 100644 --- a/Gemfile +++ b/Gemfile @@ -10,7 +10,6 @@ gem 'mimemagic', '0.4.3' gem 'rails', '~> 6.1.3.2' gem 'rest-client' gem 'uglifier' -gem 'shunter', path: '/shared/shunter/' # load env gem 'figaro', '~> 1.2' diff --git a/Gemfile.lock b/Gemfile.lock index cff5aea99..40b77456d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -73,12 +73,6 @@ GIT nokogiri (>= 1.4.0) savon (>= 2.4.0) -PATH - remote: /shared/shunter - specs: - shunter (0.1.0) - redis (~> 4.2) - GEM remote: https://rubygems.org/ specs: @@ -571,7 +565,6 @@ DEPENDENCIES sass-rails select2-rails (= 4.0.13) selectize-rails (= 0.12.6) - shunter! sidekiq simplecov (= 0.17.1) simpleidn (= 0.2.1) @@ -584,4 +577,4 @@ DEPENDENCIES wkhtmltopdf-binary (~> 0.12.5.1) BUNDLED WITH - 2.2.19 + 2.2.17