mirror of
https://github.com/mastodon/mastodon.git
synced 2026-03-03 05:51:02 +00:00
Merge 5fb7a96508 into ceaadc791e
This commit is contained in:
commit
1963bc3128
2
Gemfile
2
Gemfile
|
|
@ -27,7 +27,7 @@ gem 'addressable', '~> 2.8'
|
|||
gem 'bootsnap', require: false
|
||||
gem 'browser'
|
||||
gem 'charlock_holmes', '~> 0.7.7'
|
||||
gem 'chewy', '~> 7.3'
|
||||
gem 'chewy'
|
||||
gem 'devise'
|
||||
gem 'devise-two-factor'
|
||||
|
||||
|
|
|
|||
24
Gemfile.lock
24
Gemfile.lock
|
|
@ -159,9 +159,9 @@ GEM
|
|||
cbor (0.5.10.1)
|
||||
cgi (0.4.2)
|
||||
charlock_holmes (0.7.9)
|
||||
chewy (7.6.0)
|
||||
activesupport (>= 5.2)
|
||||
elasticsearch (>= 7.14.0, < 8)
|
||||
chewy (8.0.0)
|
||||
activesupport (>= 7.2)
|
||||
elasticsearch (>= 8.14, < 9.0)
|
||||
elasticsearch-dsl
|
||||
childprocess (5.1.0)
|
||||
logger (~> 1.5)
|
||||
|
|
@ -214,16 +214,16 @@ GEM
|
|||
dotenv (3.2.0)
|
||||
drb (2.2.3)
|
||||
dry-cli (1.4.1)
|
||||
elasticsearch (7.17.11)
|
||||
elasticsearch-api (= 7.17.11)
|
||||
elasticsearch-transport (= 7.17.11)
|
||||
elasticsearch-api (7.17.11)
|
||||
elastic-transport (8.4.1)
|
||||
faraday (< 3)
|
||||
multi_json
|
||||
elasticsearch (8.19.3)
|
||||
elastic-transport (~> 8.3)
|
||||
elasticsearch-api (= 8.19.3)
|
||||
ostruct
|
||||
elasticsearch-api (8.19.3)
|
||||
multi_json
|
||||
elasticsearch-dsl (0.1.10)
|
||||
elasticsearch-transport (7.17.11)
|
||||
base64
|
||||
faraday (>= 1, < 3)
|
||||
multi_json
|
||||
email_spec (2.3.0)
|
||||
htmlentities (~> 4.3.3)
|
||||
launchy (>= 2.1, < 4.0)
|
||||
|
|
@ -962,7 +962,7 @@ DEPENDENCIES
|
|||
capybara (~> 3.39)
|
||||
capybara-playwright-driver
|
||||
charlock_holmes (~> 0.7.7)
|
||||
chewy (~> 7.3)
|
||||
chewy
|
||||
climate_control
|
||||
cocoon (~> 1.2)
|
||||
color_diff (~> 0.1)
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class Admin::Metrics::Dimension::SoftwareVersionsDimension < Admin::Metrics::Dim
|
|||
value: version,
|
||||
human_value: version,
|
||||
}
|
||||
rescue Faraday::ConnectionFailed, Elasticsearch::Transport::Transport::Error
|
||||
rescue Faraday::ConnectionFailed, Elastic::Transport::Transport::Error
|
||||
nil
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ class Admin::Metrics::Dimension::SpaceUsageDimension < Admin::Metrics::Dimension
|
|||
unit: 'bytes',
|
||||
human_value: number_to_human_size(value),
|
||||
}
|
||||
rescue Faraday::ConnectionFailed, Elasticsearch::Transport::Transport::Error
|
||||
rescue Faraday::ConnectionFailed, Elastic::Transport::Transport::Error
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ class Admin::SystemCheck::ElasticsearchCheck < Admin::SystemCheck::BaseCheck
|
|||
return true unless Chewy.enabled?
|
||||
|
||||
running_version.present? && compatible_version? && cluster_health['status'] == 'green' && indexes_match? && specifications_match? && preset_matches?
|
||||
rescue Faraday::ConnectionFailed, Elasticsearch::Transport::Transport::Error, HTTPClient::KeepAliveDisconnected
|
||||
rescue Faraday::ConnectionFailed, Elastic::Transport::Transport::Error, HTTPClient::KeepAliveDisconnected
|
||||
false
|
||||
end
|
||||
|
||||
|
|
@ -54,7 +54,7 @@ class Admin::SystemCheck::ElasticsearchCheck < Admin::SystemCheck::BaseCheck
|
|||
else
|
||||
Admin::SystemCheck::Message.new(:elasticsearch_preset, nil, 'https://docs.joinmastodon.org/admin/elasticsearch/#scaling')
|
||||
end
|
||||
rescue Faraday::ConnectionFailed, Elasticsearch::Transport::Transport::Error, HTTPClient::KeepAliveDisconnected
|
||||
rescue Faraday::ConnectionFailed, Elastic::Transport::Transport::Error, HTTPClient::KeepAliveDisconnected
|
||||
Admin::SystemCheck::Message.new(:elasticsearch_running_check)
|
||||
end
|
||||
|
||||
|
|
@ -67,7 +67,7 @@ class Admin::SystemCheck::ElasticsearchCheck < Admin::SystemCheck::BaseCheck
|
|||
def running_version
|
||||
@running_version ||= begin
|
||||
Chewy.client.info['version']['number']
|
||||
rescue Faraday::ConnectionFailed, Elasticsearch::Transport::Transport::Error
|
||||
rescue Faraday::ConnectionFailed, Elastic::Transport::Transport::Error
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
module Elasticsearch
|
||||
module ClientExtensions
|
||||
def verify_elasticsearch
|
||||
def verify_elasticsearch(*)
|
||||
@verified = true
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ module Mastodon::CLI
|
|||
progress.finish
|
||||
|
||||
say("Indexed #{added} records, de-indexed #{removed}", :green, true)
|
||||
rescue Elasticsearch::Transport::Transport::ServerError => e
|
||||
rescue Elastic::Transport::Transport::ServerError => e
|
||||
fail_with_message <<~ERROR
|
||||
There was an issue connecting to the search server. Make sure the
|
||||
server is configured and running correctly, and that the environment
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ RSpec.describe Admin::SystemCheck::ElasticsearchCheck do
|
|||
|
||||
def stub_elasticsearch_error
|
||||
client = instance_double(Elasticsearch::Client)
|
||||
allow(client).to receive(:info).and_raise(Elasticsearch::Transport::Transport::Error)
|
||||
allow(client).to receive(:info).and_raise(Elastic::Transport::Transport::Error)
|
||||
allow(Chewy).to receive(:client).and_return(client)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ RSpec.describe Mastodon::CLI::Search do
|
|||
context 'when server communication raises an error' do
|
||||
let(:options) { { reset_chewy: true } }
|
||||
|
||||
before { allow(Chewy::Stash::Specification).to receive(:reset!).and_raise(Elasticsearch::Transport::Transport::Errors::InternalServerError) }
|
||||
before { allow(Chewy::Stash::Specification).to receive(:reset!).and_raise(Elastic::Transport::Transport::Errors::InternalServerError) }
|
||||
|
||||
it 'Exits with error message' do
|
||||
expect { subject }
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user