rss MDL-25319 replicating my optimization made to forum rss in glossary rss and database rss
This commit is contained in:
+3
-2
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user