You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mastodon/app/workers/remote_account_refresh_work...

21 lines
498 B
Ruby

# frozen_string_literal: true
class RemoteAccountRefreshWorker
include Sidekiq::Worker
include ExponentialBackoff
include JsonLdHelper
sidekiq_options queue: 'pull', retry: 3
def perform(id)
account = Account.find_by(id: id)
return if account.nil? || account.local?
ActivityPub::FetchRemoteAccountService.new.call(account.uri)
rescue Mastodon::UnexpectedResponseError => e
response = e.response
raise(e) unless response_error_unsalvageable?(response)
end
end