The code powering m.abunchtell.com https://m.abunchtell.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

18 lines
353 B

  1. # frozen_string_literal: true
  2. class BackupWorker
  3. include Sidekiq::Worker
  4. sidekiq_options queue: 'pull'
  5. def perform(backup_id)
  6. backup = Backup.find(backup_id)
  7. user = backup.user
  8. BackupService.new.call(backup)
  9. user.backups.where.not(id: backup.id).destroy_all
  10. UserMailer.backup_ready(user, backup).deliver_later
  11. end
  12. end