about summary refs log tree commit diff
path: root/app/services/unsuspend_account_service.rb
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2020-11-07 21:47:31 +0100
committerGitHub <noreply@github.com>2020-11-07 21:47:31 +0100
commitcfb16b9b70a50ec5451c9aebb2c35d3a44701311 (patch)
tree6ba298899b376d0c8862d77c1e34339a08dc3121 /app/services/unsuspend_account_service.rb
parent5a9fc749c3eab8d3c93dd282fa89c20a5cb0e994 (diff)
parente4d62042bdb3b0d675c2367b4c48a2a48647af5e (diff)
Merge pull request #1453 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/services/unsuspend_account_service.rb')
-rw-r--r--app/services/unsuspend_account_service.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/app/services/unsuspend_account_service.rb b/app/services/unsuspend_account_service.rb
index 3e731ddd9..91dbc9c18 100644
--- a/app/services/unsuspend_account_service.rb
+++ b/app/services/unsuspend_account_service.rb
@@ -18,7 +18,7 @@ class UnsuspendAccountService < BaseService
 
   def merge_into_home_timelines!
     @account.followers_for_local_distribution.find_each do |follower|
-      FeedManager.instance.merge_into_timeline(@account, follower)
+      FeedManager.instance.merge_into_home(@account, follower)
     end
   end
 
@@ -39,11 +39,15 @@ class UnsuspendAccountService < BaseService
         styles.each do |style|
           case Paperclip::Attachment.default_options[:storage]
           when :s3
-            attachment.s3_object(style).acl.put(Paperclip::Attachment.default_options[:s3_permissions])
+            attachment.s3_object(style).acl.put(acl: Paperclip::Attachment.default_options[:s3_permissions])
           when :fog
             # Not supported
           when :filesystem
-            FileUtils.chmod(0o666 & ~File.umask, attachment.path(style))
+            begin
+              FileUtils.chmod(0o666 & ~File.umask, attachment.path(style)) unless attachment.path(style).nil?
+            rescue Errno::ENOENT
+              Rails.logger.warn "Tried to change permission on non-existent file #{attachment.path(style)}"
+            end
           end
         end
       end