diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2007-10-30 22:50:44 -0400 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2007-10-30 22:50:44 -0400 |
commit | 5cbd86235e7993cc067b76105b9ed2e4fbdda3a1 (patch) | |
tree | ec07a6d5cdd5d64439642ba6c5783571eee95ad6 /IkiWiki/Plugin | |
parent | f0dab430bd8ff73b0b5d80b61d96f08bfc6c8fb0 (diff) | |
download | ikiwiki-5cbd86235e7993cc067b76105b9ed2e4fbdda3a1.tar ikiwiki-5cbd86235e7993cc067b76105b9ed2e4fbdda3a1.tar.gz |
* Fix an aggregate plugin expiry bug. Over time, it's possible for the same
page name to be expired and reused for several distinct guids. When this
happened, the expiry code counted each past guid that had used that page
name as a currently existing page, and thus expired too many pages.
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r-- | IkiWiki/Plugin/aggregate.pm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm index 6f9c78075..1add53987 100644 --- a/IkiWiki/Plugin/aggregate.pm +++ b/IkiWiki/Plugin/aggregate.pm @@ -220,9 +220,11 @@ sub expire () { #{{{ foreach my $feed (values %feeds) { next unless $feed->{expireage} || $feed->{expirecount}; my $count=0; + my %seen; foreach my $item (sort { $IkiWiki::pagectime{$b->{page}} <=> $IkiWiki::pagectime{$a->{page}} } - grep { exists $_->{page} && $_->{feed} eq $feed->{name} && $IkiWiki::pagectime{$_->{page}} } + grep { exists $_->{page} && ! exists $seen{$_->{page}} && $_->{feed} eq $feed->{name} && $IkiWiki::pagectime{$_->{page}} } values %guids) { + $seen{$item}=1; if ($feed->{expireage}) { my $days_old = (time - $IkiWiki::pagectime{$item->{page}}) / 60 / 60 / 24; if ($days_old > $feed->{expireage}) { |