From 2c05e447c3809aa179bbd74665ca65f06fe9ad5f 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 1e224ed7b74..abd3cdc4421 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