about summary refs log tree commit diff
path: root/lib/tasks
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-09-20 01:53:30 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-09-20 01:53:30 +0200
commita86f21cf90814ef0dd6e013202fb93ee83beca86 (patch)
tree0854f8b7ee148a4b6bbc35cffe7280673212bfed /lib/tasks
parent1cfc9aa20e2f4a9d7b6dcd5227246e1a5375ab31 (diff)
Fix rake tasks and loading bar
Diffstat (limited to 'lib/tasks')
-rw-r--r--lib/tasks/mastodon.rake12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/tasks/mastodon.rake b/lib/tasks/mastodon.rake
index bdfa2e458..c75028ecb 100644
--- a/lib/tasks/mastodon.rake
+++ b/lib/tasks/mastodon.rake
@@ -13,11 +13,13 @@ namespace :mastodon do
     task clear: :environment do
       Account.remote.without_followers.find_each do |a|
         Rails.logger.debug "PuSH unsubscribing from #{a.acct}"
-        a.subscription('').unsubscribe
-      rescue HTTP::Error, OpenSSL::SSL::SSLError
-        Rails.logger.debug "PuSH unsubscribing from #{a.acct} failed due to an HTTP or SSL error"
-      ensure
-        a.update!(verify_token: '', secret: '', subscription_expires_at: nil)
+        begin
+          a.subscription('').unsubscribe
+        rescue HTTP::Error, OpenSSL::SSL::SSLError
+          Rails.logger.debug "PuSH unsubscribing from #{a.acct} failed due to an HTTP or SSL error"
+        ensure
+          a.update!(verify_token: '', secret: '', subscription_expires_at: nil)
+        end
       end
     end