purge zombies


destroyer = UserDestroyer.new(Discourse.system_user)

User.where("id > 0")
    .order("RANDOM()")
    .joins(:user_stat)
    .where("user_stats.topic_count = 0 AND user_stats.post_count = 0 AND user_stats.draft_count = 0 AND user_stats.likes_given = 0")
    .each do |u|
      begin
        puts "\nProcessing user: #{u.username}"
        destroyer.destroy(u, delete_posts: false)
        puts "Successfully deleted #{u.username}"
      rescue => e
        puts "Error deleting user #{u.username}: #{e.message}"
        next  # Skip to the next user
      end
    end

Great Purge? :cold_sweat:

此举是响应半年前的 愛不愛擊斃視姦蛆
正如前所述,击毙的判据是"user_stats.topic_count = 0 AND user_stats.post_count = 0 AND user_stats.draft_count = 0 AND user_stats.likes_given = 0"

「いいね!」 2

大洪水来了 :shuiyuan3: