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() { ...@@ -2384,13 +2384,8 @@ function cron_site_data_daily() {
if (rename($viewlog, $viewlog . '.temp') and $fh = @fopen($viewlog . '.temp', 'r')) { if (rename($viewlog, $viewlog . '.temp') and $fh = @fopen($viewlog . '.temp', 'r')) {
// Read the new stuff out of the file // Read the new stuff out of the file
$latest = get_field('view_visit', 'MAX(ctime)'); $latest = get_config('viewloglatest');
if (empty($latest)) {
$latest = get_config('viewloglatest');
}
else {
set_config('viewloglatest', $latest);
}
$visits = array(); $visits = array();
while (!feof($fh)) { while (!feof($fh)) {
$line = fgets($fh, 1024); $line = fgets($fh, 1024);
...@@ -2427,6 +2422,8 @@ function cron_site_data_daily() { ...@@ -2427,6 +2422,8 @@ function cron_site_data_daily() {
execute_sql("UPDATE {view} SET visits = visits + ? WHERE id = ?", array($newvisits, $viewid)); execute_sql("UPDATE {view} SET visits = visits + ? WHERE id = ?", array($newvisits, $viewid));
} }
set_config('viewloglatest', $time);
unlink($viewlog . '.temp'); 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