标题:
dz 修改延时点击量更新的时间
[打印本页]
作者:
fangzhen
时间:
2011-1-20 09:52
标题:
dz 修改延时点击量更新的时间
dz6.0延时点击量更新的时间为1分钟,对于大网站来说这个数太大,所以需要优化,不然会死锁,具体修改如下:
function viewthread_updateviews() {
global $delayviewcount, $supe_pushstatusadd, $timestamp, $tablepre, $tid, $db, $adminid;
if(($delayviewcount == 1 || $delayviewcount == 3) && !$supe_pushstatusadd) {
$logfile = './forumdata/cache/cache_threadviews.log';
if(substr($timestamp, -1) ==
'5'
) {
require_once DISCUZ_ROOT.'./include/misc.func.php';
updateviews('threads', 'tid', 'views', $logfile);
}
if(@$fp = fopen(DISCUZ_ROOT.$logfile, 'a')) {
fwrite($fp, "$tid\n");
fclose($fp);
} elseif($adminid == 1) {
showmessage('view_log_invalid');
}
} else {
$db->query("UPDATE LOW_PRIORITY {$tablepre}threads SET views=views+1 $supe_pushstatusadd WHERE tid='$tid'", 'UNBUFFERED');
}
unset($supe_pushstatusadd);
}
'5'
按自身情况修改这个数就可以了。
欢迎光临 PHP开发笔记 (http://phpvi.com/)
Powered by Discuz! 6.1.0