Merge remote-tracking branch 'parent/main' into kbtopic-remove-quote
This commit is contained in:
commit
80542ea172
76 changed files with 658 additions and 390 deletions
|
@ -38,6 +38,11 @@ class Admin::SystemCheck::ElasticsearchCheck < Admin::SystemCheck::BaseCheck
|
|||
:elasticsearch_index_mismatch,
|
||||
mismatched_indexes.join(' ')
|
||||
)
|
||||
elsif !specifications_match?
|
||||
Admin::SystemCheck::Message.new(
|
||||
:elasticsearch_analysis_mismatch,
|
||||
mismatched_specifications_indexes.join(' ')
|
||||
)
|
||||
elsif cluster_health['status'] == 'red'
|
||||
Admin::SystemCheck::Message.new(:elasticsearch_health_red)
|
||||
elsif cluster_health['number_of_nodes'] < 2 && es_preset != 'single_node_cluster'
|
||||
|
@ -111,10 +116,20 @@ class Admin::SystemCheck::ElasticsearchCheck < Admin::SystemCheck::BaseCheck
|
|||
end
|
||||
end
|
||||
|
||||
def mismatched_specifications_indexes
|
||||
@mismatched_specifications_indexes ||= INDEXES.filter_map do |klass|
|
||||
klass.base_name if klass.specification.changed?
|
||||
end
|
||||
end
|
||||
|
||||
def indexes_match?
|
||||
mismatched_indexes.empty?
|
||||
end
|
||||
|
||||
def specifications_match?
|
||||
mismatched_specifications_indexes.empty?
|
||||
end
|
||||
|
||||
def es_preset
|
||||
ENV.fetch('ES_PRESET', 'single_node_cluster')
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue