mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-09-10 12:18:10 +00:00
* Add support for private pinned toots * Allow local user to pin private toots * Change wording to avoid "direct message"
25 lines
532 B
Ruby
25 lines
532 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
|
|
|
|
if response_error_unsalvageable?(response)
|
|
# Give up
|
|
else
|
|
raise e
|
|
end
|
|
end
|
|
end
|