]> sipb.mit.edu Git - ikiwiki.git/commitdiff
aggregate: Fix storing of changed md5.
authorJoey Hess <joey@kitenet.net>
Fri, 12 Jun 2009 23:24:47 +0000 (19:24 -0400)
committerJoey Hess <joey@kitenet.net>
Fri, 12 Jun 2009 23:24:47 +0000 (19:24 -0400)
The aggregate state merge code neglected to merge changes to the md5
field of an item. Therefore, if an item's md5 changed after initial
aggregation, it would be updated, and rewritten, each time thereafter.
This was wasteful and indirectly led to some expire problems.

IkiWiki/Plugin/aggregate.pm
debian/changelog

index e1baae666a02ffe0e9230ed4d81667a2f7ece79a..60c292d52d0db9624381271aa2dc24b001b9244e 100644 (file)
@@ -404,6 +404,7 @@ sub mergestate () {
        }
 
        # New guids can be created during aggregation.
        }
 
        # New guids can be created during aggregation.
+       # Guids have a few fields that may be updated during aggregation.
        # It's also possible that guids were removed from the on-disk state
        # while the aggregation was in process. That would only happen if
        # their feed was also removed, so any removed guids added back here
        # It's also possible that guids were removed from the on-disk state
        # while the aggregation was in process. That would only happen if
        # their feed was also removed, so any removed guids added back here
@@ -412,6 +413,11 @@ sub mergestate () {
                if (! exists $guids{$guid}) {
                        $guids{$guid}=$myguids{$guid};
                }
                if (! exists $guids{$guid}) {
                        $guids{$guid}=$myguids{$guid};
                }
+               else {
+                       foreach my $field (qw{md5}) {
+                               $guids{$guid}->{$field}=$myguids{$guid}->{$field};
+                       }
+               }
        }
 }
 
        }
 }
 
index dbf8dac88f3b2f7c7e9daa6396b67bf0f203e57c..6444fb8ba7fec2f0cd59d20a9d757b4094dbb433 100644 (file)
@@ -24,6 +24,7 @@ ikiwiki (3.141) UNRELEASED; urgency=low
     openid or openid2.
   * Disable the Preferences link if no plugin with an auth hook is enabled.
   * Updated French translation. Closes: #532654
     openid or openid2.
   * Disable the Preferences link if no plugin with an auth hook is enabled.
   * Updated French translation. Closes: #532654
+  * aggregate: Fix storing of changed md5.
 
  -- Joey Hess <joeyh@debian.org>  Tue, 02 Jun 2009 17:03:41 -0400
 
 
  -- Joey Hess <joeyh@debian.org>  Tue, 02 Jun 2009 17:03:41 -0400