This repository has been archived on 2024-06-09. You can view files and clone it, but cannot push or open issues/pull-requests.
2018-02-21 23:21:32 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class Scheduler::BackupCleanupScheduler
|
|
|
|
include Sidekiq::Worker
|
|
|
|
|
2018-08-19 15:48:29 +02:00
|
|
|
sidekiq_options unique: :until_executed
|
|
|
|
|
2018-02-21 23:21:32 +01:00
|
|
|
def perform
|
|
|
|
old_backups.find_each(&:destroy!)
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def old_backups
|
|
|
|
Backup.where('created_at < ?', 7.days.ago)
|
|
|
|
end
|
|
|
|
end
|