mirror of
https://github.com/discourse/discourse.git
synced 2024-12-15 14:23:55 +08:00
FEATURE: Use created_at to remove an ip if its last_match_at is null
This commit is contained in:
parent
e5d2b49119
commit
2c05e447c3
|
@ -11,7 +11,7 @@ module Jobs
|
||||||
|
|
||||||
# remove old unmatched IP addresses
|
# remove old unmatched IP addresses
|
||||||
ScreenedIpAddress.where(action_type: ScreenedIpAddress.actions[:block])
|
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
|
.destroy_all
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user