mirror of
https://github.com/mastodon/mastodon.git
synced 2024-10-19 01:01:23 +09:00
Use shared connection error array in stoplight handlers
This commit is contained in:
parent
2404d6d1a1
commit
764b044e02
@ -242,7 +242,7 @@ module SignatureVerification
|
||||
Stoplight("source:#{request.remote_ip}")
|
||||
.with_threshold(1)
|
||||
.with_cool_off_time(5.minutes.seconds)
|
||||
.with_error_handler { |error, handle| error.is_a?(HTTP::Error) || error.is_a?(OpenSSL::SSL::SSLError) ? handle.call(error) : raise(error) }
|
||||
.with_error_handler { |error, handle| Mastodon::HTTP_CONNECTION_ERRORS.any? { |error_class| error.is_a?(error_class) } ? handle.call(error) : raise(error) }
|
||||
end
|
||||
|
||||
def actor_refresh_key!(actor)
|
||||
|
@ -57,7 +57,7 @@ class BulkImportRowService
|
||||
.with_fallback { nil }
|
||||
.with_threshold(1)
|
||||
.with_cool_off_time(5.minutes.seconds)
|
||||
.with_error_handler { |error, handle| error.is_a?(HTTP::Error) || error.is_a?(OpenSSL::SSL::SSLError) ? handle.call(error) : raise(error) }
|
||||
.with_error_handler { |error, handle| Mastodon::HTTP_CONNECTION_ERRORS.any? { |error_class| error.is_a?(error_class) } ? handle.call(error) : raise(error) }
|
||||
else
|
||||
Stoplight('domain-blank')
|
||||
end
|
||||
|
@ -49,7 +49,7 @@ class Import::RelationshipWorker
|
||||
.with_fallback { nil }
|
||||
.with_threshold(1)
|
||||
.with_cool_off_time(5.minutes.seconds)
|
||||
.with_error_handler { |error, handle| error.is_a?(HTTP::Error) || error.is_a?(OpenSSL::SSL::SSLError) ? handle.call(error) : raise(error) }
|
||||
.with_error_handler { |error, handle| Mastodon::HTTP_CONNECTION_ERRORS.any? { |error_class| error.is_a?(error_class) } ? handle.call(error) : raise(error) }
|
||||
else
|
||||
Stoplight('domain-blank')
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user