diff --git a/app/workers/version_check_worker.rb b/app/workers/version_check_worker.rb
index 820670cfd..b6e5a605e 100644
--- a/app/workers/version_check_worker.rb
+++ b/app/workers/version_check_worker.rb
@@ -21,6 +21,8 @@ class VersionCheckWorker
setting_ver.save!
setting_key = Setting.find_or_initialize_by(name: 'hub_public_key')
+ return if setting_key.value == res['key']
+
setting_key.value = res['key']
setting_key.save!
end
diff --git a/doc/environment.md b/doc/environment.md
index 07252f308..0a2152dcd 100644
--- a/doc/environment.md
+++ b/doc/environment.md
@@ -243,6 +243,11 @@ By default, theses variables are not present in application.yml because they are
Optional email of the administrator account in charge of the system administration.
If specified, it will be hidden from the administrators list and it will exclusively receive the notifications related to the system administration.
If not specified, every admins will receive system administration notifications.
+
+
+ FORCE_VERSION_CHECK
+
+In test and development environments, the version won't be check automatically, unless this variable is set to "true".
## Internationalization setting.
diff --git a/lib/version.rb b/lib/version.rb
index 34aa27d69..8a809c998 100644
--- a/lib/version.rb
+++ b/lib/version.rb
@@ -16,6 +16,8 @@ class Version
end
def self.check_and_schedule
+ return if Rails.env.development? && !ENV['FORCE_VERSION_CHECK']
+
VersionCheckWorker.perform_async
# every sunday at 1:15am
m = DateTime.current.minute