0
0
Fork 0

Fix rake tasks and loading bar

This commit is contained in:
Eugen Rochko 2016-09-20 01:53:30 +02:00
parent 1cfc9aa20e
commit a86f21cf90
3 changed files with 17 additions and 7 deletions

View file

@ -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