From afb566260e3a13c4f12141eafb93d4d803bfe3d6 Mon Sep 17 00:00:00 2001 From: cpradio Date: Fri, 5 Jun 2015 08:04:04 -0400 Subject: [PATCH] FEATURE: Use created_at to remove an ip if its last_match_at is null --- app/jobs/scheduled/clean_up_unmatched_ips.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/jobs/scheduled/clean_up_unmatched_ips.rb b/app/jobs/scheduled/clean_up_unmatched_ips.rb index 1e224ed7b..abd3cdc44 100644 --- a/app/jobs/scheduled/clean_up_unmatched_ips.rb +++ b/app/jobs/scheduled/clean_up_unmatched_ips.rb @@ -11,7 +11,7 @@ module Jobs # remove old unmatched IP addresses ScreenedIpAddress.where(action_type: ScreenedIpAddress.actions[:block]) - .where("last_match_at < ?", last_match_threshold) + .where("last_match_at < ? OR (last_match_at IS NULL AND created_at < ?)", last_match_threshold, last_match_threshold) .destroy_all end