5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 19:56:21 +00:00

fix: activejob gestiona errores por su cuenta

closes #15351

closes #15352

closes #15612

closes #15618

closes #15621

closes #15622

closes #15623

closes #15729

closes #15730

closes #15731

closes #15735

closes #15736

closes #15776

closes #15824

closes #15827

closes #15828

closes #15829

closes #15830

closes #15831

closes #15832

closes #15838

closes #15839

closes #15882
This commit is contained in:
f 2024-03-28 10:13:13 -03:00
parent ca4017dbd0
commit 3f7f887841
No known key found for this signature in database

View file

@ -19,25 +19,16 @@ class ActivityPub
#
# @param error [Exception]
# @return [Bool]
def handle_error(error)
case error
when FastJsonparser::ParseError
expire
ExceptionNotifier.notify_exception(error, data: { site: site.name, object: object.uri, body: response.body })
false
when ActiveRecord::RecordInvalid, SocketError, SystemCallError, Net::OpenTimeout, OpenSSL::OpenSSLError
retry_in(ApplicationJob.random_wait)
false
else
expire
true
end
discard_on(FastJsonparser::ParseError) do |error|
ExceptionNotifier.notify_exception(error, data: { site: site.name, object: object.uri, body: response.body })
end
retry_on ActiveRecord::RecordInvalid
retry_on SocketError, wait: ApplicationJob.random_wait
retry_on SystemCallError, wait: ApplicationJob.random_wait
retry_on Net::OpenTimeout, wait: ApplicationJob.random_wait
retry_on OpenSSL::OpenSSLError, wait: ApplicationJob.random_wait
def perform(site:, object_id:)
ActivityPub::Object.transaction do
@site = site