1
0
mirror of https://github.com/moodle/moodle.git synced 2025-05-14 04:06:39 +02:00

rss MDL-25319 replicating my optimization made to forum rss in glossary rss and database rss

This commit is contained in:
Andrew Davis 2010-11-19 06:56:23 +00:00
parent e3c21e8c13
commit c02f338e5e
2 changed files with 6 additions and 4 deletions
mod

@ -34,8 +34,9 @@
if (file_exists($cachedfilepath)) {
$cachedfilelastmodified = filemtime($cachedfilepath);
}
if (data_rss_newstuff($data, $cachedfilelastmodified)) {
//if the cache is more than 60 seconds old and there's new stuff
$dontrecheckcutoff = time()-60;
if ( $dontrecheckcutoff > $cachedfilelastmodified && data_rss_newstuff($data, $cachedfilelastmodified)) {
require_once($CFG->dirroot . '/mod/data/lib.php');
// Get the first field in the list (a hack for now until we have a selector)

@ -37,8 +37,9 @@
if (file_exists($cachedfilepath)) {
$cachedfilelastmodified = filemtime($cachedfilepath);
}
if (glossary_rss_newstuff($glossary, $cachedfilelastmodified)) {
//if the cache is more than 60 seconds old and there's new stuff
$dontrecheckcutoff = time()-60;
if ( $dontrecheckcutoff > $cachedfilelastmodified && glossary_rss_newstuff($glossary, $cachedfilelastmodified)) {
if (!$recs = $DB->get_records_sql($sql, array(), 0, $glossary->rssarticles)) {
return null;
}