Follow up to #39323 - for tag_search_service (#39375)

This commit is contained in:
Shlee 2026-06-11 22:44:20 +09:30 committed by GitHub
parent 655dca8a78
commit e52fc4a0c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,8 @@
# frozen_string_literal: true
class TagSearchService < BaseService
include SearchStoplight
def call(query, options = {})
MastodonOTELTracer.in_span('TagSearchService#call') do |span|
@query = query.strip.delete_prefix('#')
@ -29,8 +31,8 @@ class TagSearchService < BaseService
definition = TagsIndex.query(elastic_search_query)
definition = definition.filter(elastic_search_filter) if @options[:exclude_unreviewed]
ensure_exact_match(definition.limit(@limit).offset(@offset).objects.compact)
rescue Faraday::ConnectionFailed, Parslet::ParseFailed, Errno::ENETUNREACH
elastic_stoplight_wrapper.run { ensure_exact_match(definition.limit(@limit).offset(@offset).objects.compact) }
rescue Stoplight::Error::RedLight, Faraday::ConnectionFailed, Parslet::ParseFailed, Errno::ENETUNREACH, OpenSSL::SSL::SSLError, Elastic::Transport::Transport::Error
nil
end