about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2021-05-12 11:03:05 +0200
committerClaire <claire.github-309c@sitedethib.com>2021-05-12 11:03:05 +0200
commitdc58d02192baef0bd006d80f10f018f01dc5ff0f (patch)
treeae1e316aa745d8c28551bf418ad6d47bc83c55a4 /app/services
parentffc3f8eebe134ca9b18af73aa29eaa1627082e40 (diff)
parent70f6f2e9b70afe5af17ee9aaec777565bdef8aed (diff)
Merge branch 'main' into glitch-soc/merge-upstream
Diffstat (limited to 'app/services')
-rw-r--r--app/services/activitypub/process_account_service.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/app/services/activitypub/process_account_service.rb b/app/services/activitypub/process_account_service.rb
index bb2e8f665..7e268f4d4 100644
--- a/app/services/activitypub/process_account_service.rb
+++ b/app/services/activitypub/process_account_service.rb
@@ -106,8 +106,16 @@ class ActivityPub::ProcessAccountService < BaseService
   end
 
   def set_fetchable_attributes!
-    @account.avatar_remote_url = image_url('icon')  || '' unless skip_download?
-    @account.header_remote_url = image_url('image') || '' unless skip_download?
+    begin
+      @account.avatar_remote_url = image_url('icon') || '' unless skip_download?
+    rescue Mastodon::UnexpectedResponseError, HTTP::TimeoutError, HTTP::ConnectionError, OpenSSL::SSL::SSLError
+      RedownloadAvatarWorker.perform_in(rand(30..600).seconds, @account.id)
+    end
+    begin
+      @account.header_remote_url = image_url('image') || '' unless skip_download?
+    rescue Mastodon::UnexpectedResponseError, HTTP::TimeoutError, HTTP::ConnectionError, OpenSSL::SSL::SSLError
+      RedownloadHeaderWorker.perform_in(rand(30..600).seconds, @account.id)
+    end
     @account.statuses_count    = outbox_total_items    if outbox_total_items.present?
     @account.following_count   = following_total_items if following_total_items.present?
     @account.followers_count   = followers_total_items if followers_total_items.present?