diff options
Diffstat (limited to 'lib/exe/indexer.php')
-rw-r--r-- | lib/exe/indexer.php | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/exe/indexer.php b/lib/exe/indexer.php index 3ab117736..d2a4d45f7 100644 --- a/lib/exe/indexer.php +++ b/lib/exe/indexer.php @@ -51,8 +51,9 @@ exit; /** * Trims the recent changes cache (or imports the old changelog) as needed. * - * @param media_changes If the media changelog shall be trimmed instead of - * the page changelog + * @param bool $media_changes If the media changelog shall be trimmed instead of + * the page changelog + * @return bool * * @author Ben Coburn <btcoburn@silicodon.net> */ @@ -67,9 +68,9 @@ function runTrimRecentChanges($media_changes = false) { // Trims the recent changes cache to the last $conf['changes_days'] recent // changes or $conf['recent'] items, which ever is larger. // The trimming is only done once a day. - if (@file_exists($fn) && + if (file_exists($fn) && (@filemtime($fn.'.trimmed')+86400)<time() && - !@file_exists($fn.'_tmp')) { + !file_exists($fn.'_tmp')) { @touch($fn.'.trimmed'); io_lock($fn); $lines = file($fn); @@ -83,7 +84,7 @@ function runTrimRecentChanges($media_changes = false) { io_saveFile($fn.'_tmp', ''); // presave tmp as 2nd lock $trim_time = time() - $conf['recent_days']*86400; $out_lines = array(); - + $old_lines = array(); for ($i=0; $i<count($lines); $i++) { $log = parseChangelogLine($lines[$i]); if ($log === false) continue; // discard junk @@ -198,7 +199,7 @@ function sendGIF(){ header('Content-Length: '.strlen($img)); header('Connection: Close'); print $img; - flush(); + tpl_flush(); // Browser should drop connection after this // Thinks it's got the whole image } |