about summary refs log tree commit diff
path: root/app/lib/admin/system_check
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2023-01-18 18:41:24 +0100
committerGitHub <noreply@github.com>2023-01-18 18:41:24 +0100
commit01405bc6f84fd9cfb974e1e668465148bda47ac5 (patch)
treecb3103c82a337178a3548e1a157e0fa94be37bdb /app/lib/admin/system_check
parent472fd4307f9c963aba57e537e3ca3a8f94dfa139 (diff)
parent3f74235ac5b6ce6f13c531506f30c466da2a7aa1 (diff)
Merge pull request #2087 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/lib/admin/system_check')
-rw-r--r--app/lib/admin/system_check/elasticsearch_check.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/app/lib/admin/system_check/elasticsearch_check.rb b/app/lib/admin/system_check/elasticsearch_check.rb
index 7f922978f..5b4c12399 100644
--- a/app/lib/admin/system_check/elasticsearch_check.rb
+++ b/app/lib/admin/system_check/elasticsearch_check.rb
@@ -30,19 +30,24 @@ class Admin::SystemCheck::ElasticsearchCheck < Admin::SystemCheck::BaseCheck
 
   def running_version
     @running_version ||= begin
-      Chewy.client.info['version']['minimum_wire_compatibility_version'] ||
-        Chewy.client.info['version']['number']
+      Chewy.client.info['version']['number']
     rescue Faraday::ConnectionFailed
       nil
     end
   end
 
+  def compatible_wire_version
+    Chewy.client.info['version']['minimum_wire_compatibility_version']
+  end
+
   def required_version
     '7.x'
   end
 
   def compatible_version?
     return false if running_version.nil?
-    Gem::Version.new(running_version) >= Gem::Version.new(required_version)
+
+    Gem::Version.new(running_version) >= Gem::Version.new(required_version) ||
+      Gem::Version.new(compatible_wire_version) >= Gem::Version.new(required_version)
   end
 end