mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-16 05:04:02 -05:00
18 lines
353 B
Ruby
18 lines
353 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
class BackupWorker
|
||
|
include Sidekiq::Worker
|
||
|
|
||
|
sidekiq_options queue: 'pull'
|
||
|
|
||
|
def perform(backup_id)
|
||
|
backup = Backup.find(backup_id)
|
||
|
user = backup.user
|
||
|
|
||
|
BackupService.new.call(backup)
|
||
|
|
||
|
user.backups.where.not(id: backup.id).destroy_all
|
||
|
UserMailer.backup_ready(user, backup).deliver_later
|
||
|
end
|
||
|
end
|