feature #478, improve performances
By reducing frequency of update on user_infos.last_visit. Instead of updating on each page visit, we wait at least a session length, which is 30 minutes by default. @modus75 suggested to use function log_user instead, which is a better design. Unfortunately it would lead to much less accuracy, because on many systems PHP sessions are never purged (Debian with default settings). It would be possible to come back everyday and never update the last_visit, as long as the web browser is not closed.
This commit is contained in:
parent
27c2871ca2
commit
724befb35d
1 changed files with 5 additions and 1 deletions
|
@ -411,7 +411,11 @@ function pwg_log($image_id = null, $image_type = null, $format_id = null)
|
|||
{
|
||||
global $conf, $user, $page;
|
||||
|
||||
$update_last_visit = true;
|
||||
$update_last_visit = false;
|
||||
if (empty($user['last_visit']) or strtotime($user['last_visit']) < time()-$conf['session_length'])
|
||||
{
|
||||
$update_last_visit = true;
|
||||
}
|
||||
$update_last_visit = trigger_change('pwg_log_update_last_visit', $update_last_visit);
|
||||
|
||||
if ($update_last_visit)
|
||||
|
|
Loading…
Reference in a new issue