From f689e45b94cc2af61a7ed6dd23b7e7b07b51a982 Mon Sep 17 00:00:00 2001 From: Urban Hafner Date: Tue, 7 Jan 2025 10:16:09 +0100 Subject: [PATCH] Delete old user agent data --- app/workers/clean_up.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/workers/clean_up.rb b/app/workers/clean_up.rb index 33af29e70..161d4c07e 100644 --- a/app/workers/clean_up.rb +++ b/app/workers/clean_up.rb @@ -5,6 +5,7 @@ def perform remove_unused_accounts remove_unconfirmed_accounts anonymize_sign_up_ip + remove_old_user_agents end private @@ -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