Remove one cache to possible cure some "headers_in" instability.
authorshort <>
Thu, 29 Sep 2005 09:15:11 +0000 (09:15 +0000)
committershort <>
Thu, 29 Sep 2005 09:15:11 +0000 (09:15 +0000)
project/Lib.pm

index c89683a..4fde277 100644 (file)
@@ -210,6 +210,7 @@ sub list($)
 {
 my($self)=@_;
 
+       # This cache is "headers_in" hits safe - only local files reading.
        our %list_cache;
        our @list_cache;
        if (!@list_cache) {
@@ -239,15 +240,11 @@ my($class,$name)=@_;
        return map(($_=>$class->name_to_hashref($_)),$class->list()) if !$name;
        cluck join(" ","Project name \"$name\" not listed in 'list_cache':",$class->list())
                        if !$class->list()->{$name};
-       # Do not cache &Wrequire to gets its $Id$ markers / usage map.
+       # Never cache anything to be stable for "headers_in" hits.
        Wrequire "project::${name}::Index";
-       our %cache;
-       if (!$cache{$name}) {
-               my $arrayref=eval('\@project::'.$name.'::Index::ListItem');
-               do { warn "Broken project/$name/Index.pm"; return undef(); } if !@$arrayref;
-               $cache{$name}=$class->project_arrayref_to_hashref($arrayref);
-               }
-       return $cache{$name};
+       my $arrayref=eval('\@project::'.$name.'::Index::ListItem');
+       do { warn "Broken project/$name/Index.pm"; return undef(); } if !@$arrayref;
+       return $class->project_arrayref_to_hashref($arrayref);
 }
 
 # $args{"ListItem"}=\%...;