logo

mastofe

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

user_cleanup_scheduler.rb (373B)


  1. # frozen_string_literal: true
  2. require 'sidekiq-scheduler'
  3. class Scheduler::UserCleanupScheduler
  4. include Sidekiq::Worker
  5. def perform
  6. User.where('confirmed_at is NULL AND confirmation_sent_at <= ?', 2.days.ago).find_in_batches do |batch|
  7. Account.where(id: batch.map(&:account_id)).delete_all
  8. User.where(id: batch.map(&:id)).delete_all
  9. end
  10. end
  11. end