Skip to content

Commit

Permalink
Delete old user agent data
Browse files Browse the repository at this point in the history
  • Loading branch information
ujh committed Jan 7, 2025
1 parent dcf3d48 commit f689e45
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/workers/clean_up.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ def perform
remove_unused_accounts
remove_unconfirmed_accounts
anonymize_sign_up_ip
remove_old_user_agents
end

private
Expand All @@ -28,4 +29,8 @@ def remove_unconfirmed_accounts
def anonymize_sign_up_ip
User.where("created_at < ?", 1.month.ago).update_all(sign_up_ip: nil)
end

def remove_old_user_agents
UserAgent.where("created_at < ?", 3.months.ago).destroy_all
end
end

0 comments on commit f689e45

Please sign in to comment.