From 837ef6f2e52f316089ecffb55eb6aea49d832047 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Tue, 3 Nov 2020 12:12:43 +0000 Subject: [PATCH] FIX: Remove 4 month limit on IgnoredUser records (#11105) b8c676e7 added the 'forever' option to the UI, and this is correctly stored in the database. However, we had a hard-coded limit of 4 months in the cleanup job. This commit removes the limit, so ignores can last forever. --- app/jobs/scheduled/purge_expired_ignored_users.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/jobs/scheduled/purge_expired_ignored_users.rb b/app/jobs/scheduled/purge_expired_ignored_users.rb index 96b10837a6..0c2a87c8c9 100644 --- a/app/jobs/scheduled/purge_expired_ignored_users.rb +++ b/app/jobs/scheduled/purge_expired_ignored_users.rb @@ -5,7 +5,8 @@ module Jobs every 1.day def execute(args) - IgnoredUser.where("created_at <= ? OR expiring_at <= ?", 4.months.ago, Time.zone.now).delete_all + IgnoredUser.where("expiring_at <= ?", Time.zone.now).delete_all + IgnoredUser.where("created_at <= ? AND expiring_at IS NULL", 4.months.ago).delete_all end end end