Mercurial > hg > maltfilter
changeset 25:34dcb7462043
Sanitize weeding of entries, separating blocklist weeding from global lists.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 15 Aug 2009 23:21:30 +0300 |
parents | f22cfa761753 |
children | 61b6d742c49c |
files | maltfilter |
diffstat | 1 files changed, 22 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/maltfilter Sat Aug 15 23:11:20 2009 +0300 +++ b/maltfilter Sat Aug 15 23:21:30 2009 +0300 @@ -499,6 +499,7 @@ # Don't weed in report mode. return if ($reportmode); + # Weed blocked entries. my @mips = keys %blocklist; foreach my $mip (@mips) { if (defined($blocklist{$mip})) { @@ -509,6 +510,27 @@ } } } + + # Clean up old entries from other lists + foreach my $mip (keys %statlist) { + if (defined($statlist{$mip})) { + my $mtime = $statlist{$mip}{"date2"}; + if (!check_time($mtime) && !defined($blocklist{$mip})) { + mlog(3, "* Deleting stale $mip (".($mtime >= 0 ? scalar localtime($mtime) : $mtime).")\n"); + delete($statlist{$mip}); + } + } + } + + foreach my $mip (keys %ignorelist) { + if (defined($ignorelist{$mip})) { + my $mtime = $ignorelist{$mip}{"date2"}; + if (!check_time($mtime)) { + mlog(3, "* Deleting stale ignored $mip (".($mtime >= 0 ? scalar localtime($mtime) : $mtime).")\n"); + delete($ignorelist{$mip}); + } + } + } } ### Update one entry of