The code powering m.abunchtell.com https://m.abunchtell.com
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 

20 wiersze
391 B

  1. # frozen_string_literal: true
  2. class RedownloadMediaWorker
  3. include Sidekiq::Worker
  4. include ExponentialBackoff
  5. sidekiq_options queue: 'pull', retry: 3
  6. def perform(id)
  7. media_attachment = MediaAttachment.find(id)
  8. return if media_attachment.remote_url.blank?
  9. media_attachment.reset_file!
  10. media_attachment.save
  11. rescue ActiveRecord::RecordNotFound
  12. true
  13. end
  14. end