From 9e618274fc38a6dfee896930e56581ddca70b472 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 3 Mar 2020 18:27:43 +0100 Subject: [PATCH] prevent multiple version check at start time --- lib/version.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/version.rb b/lib/version.rb index 19dd28b36..e13dfe35f 100644 --- a/lib/version.rb +++ b/lib/version.rb @@ -19,7 +19,10 @@ class Version return if (Rails.env.development? || Rails.env.test?) && ENV['FORCE_VERSION_CHECK'] != 'true' VersionCheckWorker.perform_async - # every sunday at 1:15am + return if Sidekiq::Cron::Job.find name: 'Automatic version check' + + # schedule version check every day at the current time + # this will prevent that all the instances to query the hub simultaneously m = DateTime.current.minute h = DateTime.current.hour d = DateTime.current.cwday