Skip to content

Commit

Permalink
Kneecap the user cleaner
Browse files Browse the repository at this point in the history
  • Loading branch information
Splines committed Mar 12, 2024
1 parent 39d6eab commit 69c2409
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions app/models/user_cleaner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ def send_hashes
end

def delete_ghosts
@hash_dict.each do |mail, hash|
u = User.find_by(email: mail, ghost_hash: hash)
move_mail(@email_dict[mail]) if u.present? && @email_dict.present?
u.destroy! if u&.generic?
end
# @hash_dict.each do |mail, hash|
# u = User.find_by(email: mail, ghost_hash: hash)
# move_mail(@email_dict[mail]) if u.present? && @email_dict.present?
# u.destroy! if u&.generic?
# end
end

def move_mail(message_ids, attempt = 0)
Expand All @@ -111,14 +111,15 @@ def move_mail(message_ids, attempt = 0)
end

def clean!
login
search_emails_and_hashes
return if @email_dict.blank?

send_hashes
sleep(10)
search_emails_and_hashes
delete_ghosts
logout
# TODO: Implement new old user cleaner logic
# login
# search_emails_and_hashes
# return if @email_dict.blank?

# send_hashes
# sleep(10)
# search_emails_and_hashes
# delete_ghosts
# logout
end
end

0 comments on commit 69c2409

Please sign in to comment.