Skip to content

Commit

Permalink
rss MDL-25319 adding a check to avoid some work if the same rss feed …
Browse files Browse the repository at this point in the history
…is requested repeatedly
  • Loading branch information
Andrew Davis committed Nov 19, 2010
1 parent bb7603e commit da8ae44
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mod/forum/rsslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ function forum_rss_get_feed($context, $args) {
if (file_exists($cachedfilepath)) {
$cachedfilelastmodified = filemtime($cachedfilepath);
}
if (forum_rss_newstuff($forum, $cm, $cachedfilelastmodified)) {
//if the cache is more than 60 seconds old and there's new stuff
$dontrecheckcutoff = time()-60;
if ( $dontrecheckcutoff > $cachedfilelastmodified && forum_rss_newstuff($forum, $cm, $cachedfilelastmodified)) {
//need to regenerate the cached version
$result = forum_rss_feed_contents($forum, $sql);
if (!empty($result)) {
Expand Down

0 comments on commit da8ae44

Please sign in to comment.