]> sipb.mit.edu Git - ikiwiki.git/commitdiff
* Fix an aggregate plugin expiry bug. Over time, it's possible for the same
authorJoey Hess <joey@kodama.kitenet.net>
Wed, 31 Oct 2007 02:50:44 +0000 (22:50 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Wed, 31 Oct 2007 02:50:44 +0000 (22:50 -0400)
  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.

IkiWiki/Plugin/aggregate.pm
debian/changelog

index 6f9c78075f88509524314feea170e48e50377398..1add539874bd478f8213073300c2469aae92931f 100644 (file)
@@ -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}) {
index 9684a02d5a6e53806d033b44d25c6d1026da67db..3817f142aabe4345c4da007de5a7ddc6e2818a64 100644 (file)
@@ -1,8 +1,12 @@
 ikiwiki (2.12) UNRELEASED; urgency=low
 
   * Fix some issues with toggles in preview mode.
+  * 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.
 
- -- Joey Hess <joeyh@debian.org>  Mon, 29 Oct 2007 17:15:04 -0400
+ -- Joey Hess <joeyh@debian.org>  Tue, 30 Oct 2007 22:47:36 -0400
 
 ikiwiki (2.11) unstable; urgency=low