From 3de56c09cc742302fb0b2d1a5684026689cb7fc2 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Thu, 5 Jul 2018 17:25:13 +0200 Subject: [PATCH] Small delay before sync dates at creation --- app/models/check.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/models/check.rb b/app/models/check.rb index fa4c2aa..5e0ad39 100644 --- a/app/models/check.rb +++ b/app/models/check.rb @@ -100,8 +100,10 @@ class Check < ApplicationRecord return unless active? return unless saved_changes.key?("domain") - WhoisSyncJob.perform_later(id) if domain? - SSLSyncJob.perform_later(id) if ssl? + # small delay before first sync, otherwise on fast system + # the db won't return the check immediately after insert + WhoisSyncJob.perform_later(id, delay: 1.second) if domain? + SSLSyncJob.perform_later(id, delay: 1.second) if ssl? end def reset_notifications