Changeset 258

Show
Ignore:
Timestamp:
11/14/06 21:19:25 (7 years ago)
Author:
lincoln
Message:

fix bug in ninemsn caching

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • grabbers/ninemsn

    r257 r258  
    684684                        # not in cache, go fetch additional details if we can 
    685685                        &fetch_one_prog($cache_key, $prog->{url}, $prog_count, $stats{programmes}); 
    686  
    687                         # if we got additional details, add them now 
    688                         if (defined $data_cache->{$cache_key}) { 
    689                                 foreach my $key (keys %{($data_cache->{$cache_key})}) { 
    690                                         $prog->{$key} = $data_cache->{$cache_key}->{$key}; 
    691                                 } 
     686                        $stats{added_to_cache}++; 
     687                        &write_cache if ((($stats{added_to_cache} % 5) == 0) && (!defined $opt->{no_cache})); 
     688                } else { 
     689                        $stats{used_existing_cache_entry}++; 
     690                } 
     691 
     692                # if we got additional details, add them now 
     693                if (defined $data_cache->{$cache_key}) { 
     694                        foreach my $key (keys %{($data_cache->{$cache_key})}) { 
     695                                $prog->{$key} = $data_cache->{$cache_key}->{$key}; 
    692696                        } 
    693  
    694                         $added_to_cache++; 
    695                         &write_cache if ((($added_to_cache % 5) == 0) && (!defined $opt->{no_cache})); 
    696697                } 
    697  
    698698 
    699699                # if we now have a length field, use that as a more accurate