The code powering m.abunchtell.com https://m.abunchtell.com
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 

21 строка
653 B

  1. class SubscribeService < BaseService
  2. def call(account)
  3. account.secret = SecureRandom.hex
  4. account.verify_token = SecureRandom.hex
  5. subscription = account.subscription(api_subscription_url(account.id))
  6. response = subscription.subscribe
  7. unless response.successful?
  8. account.secret = ''
  9. account.verify_token = ''
  10. Rails.logger.debug "PuSH subscription request for #{account.acct} failed: #{response.message}"
  11. end
  12. account.save!
  13. rescue HTTP::Error, OpenSSL::SSL::SSLError
  14. Rails.logger.debug "PuSH subscription request for #{account.acct} could not be made due to HTTP or SSL error"
  15. end
  16. end