Ignore:
Timestamp:
May 25, 2006, 6:09:10 PM (15 years ago)
Author:
nick
Message:

Explicitly request the feed timestamp at the same time as the feed, to avoid Wiki::Toolkit having to do the node fetch twice. The feed_timestamp method on OpenGuides::Feed should no longer be used, as it requires another fetch, and only makes sense if you only ever deal with recent changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/OpenGuides.pm

    r790 r791  
    690690    my $locale   = $args{locale}   || "";
    691691    my %criteria = (
    692                        items              => $items,
    693                        days               => $days,
    694                        ignore_minor_edits => $ignore_minor_edits,
    695                        feed_type          => $feed_type,
    696                        feed_listing       => $feed_listing,
     692                       items                 => $items,
     693                       days                  => $days,
     694                       ignore_minor_edits    => $ignore_minor_edits,
     695                       feed_type             => $feed_type,
     696                       feed_listing          => $feed_listing,
     697                       also_return_timestamp => 1,
    697698                   );
    698699    my %filter;
     
    722723    }
    723724   
    724     $output .= "Last-Modified: " . $feed->feed_timestamp( %criteria ) . "\n\n";
    725 
    726     $output .= $feed->make_feed( %criteria );
     725    # Get the feed, and the timestamp, in one go
     726    my ($feed_output, $feed_timestamp) =
     727        $feed->make_feed( %criteria );
     728
     729    $output .= "Last-Modified: " . $feed_timestamp . "\n\n";
     730    $output .= $feed_output;
    727731
    728732    return $output if $return_output;
Note: See TracChangeset for help on using the changeset viewer.