mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
rss MDL-25319 adding a check to avoid some work if the same rss feed is requested repeatedly
This commit is contained in:
parent
bb7603e900
commit
da8ae44ead
1 changed files with 3 additions and 1 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue