logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

backup_cleanup_scheduler.rb (271B)


  1. # frozen_string_literal: true
  2. require 'sidekiq-scheduler'
  3. class Scheduler::BackupCleanupScheduler
  4. include Sidekiq::Worker
  5. def perform
  6. old_backups.find_each(&:destroy!)
  7. end
  8. private
  9. def old_backups
  10. Backup.where('created_at < ?', 7.days.ago)
  11. end
  12. end