Commit 26abf06c authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Fix update of last view log processing time


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent 175d69c7
......@@ -2384,13 +2384,8 @@ function cron_site_data_daily() {
if (rename($viewlog, $viewlog . '.temp') and $fh = @fopen($viewlog . '.temp', 'r')) {
// Read the new stuff out of the file
$latest = get_field('view_visit', 'MAX(ctime)');
if (empty($latest)) {
$latest = get_config('viewloglatest');
}
else {
set_config('viewloglatest', $latest);
}
$latest = get_config('viewloglatest');
$visits = array();
while (!feof($fh)) {
$line = fgets($fh, 1024);
......@@ -2427,6 +2422,8 @@ function cron_site_data_daily() {
execute_sql("UPDATE {view} SET visits = visits + ? WHERE id = ?", array($newvisits, $viewid));
}
set_config('viewloglatest', $time);
unlink($viewlog . '.temp');
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment