mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-29 23:32:54 +09:00
Automatically fill cache in ncenterliteModel->_getNewCount()
285ea8a 보완
카운트 캐시가 없는 경우 자동으로 캐시를 생성하도록 변경함.
푸시앱 등 알림 내용은 안 불러오고 카운트만 받아가는 경우가 있어서
이렇게 하지 않으면 반복 호출해도 캐시 효과가 없음.
푸시앱 사용자가 많고 알림이 수천~수만 개씩 쌓이는 사이트에서
이 패치 적용 후 DB서버 부하가 50% 이상 줄어들었음.
This commit is contained in:
parent
285ea8a8ed
commit
c9d3645f10
1 changed files with 6 additions and 0 deletions
|
|
@ -367,6 +367,12 @@ class ncenterliteModel extends ncenterlite
|
|||
{
|
||||
return $output->total_count;
|
||||
}
|
||||
elseif (Rhymix\Framework\Cache::getDriverName() !== 'dummy')
|
||||
{
|
||||
$output = $this->_getMyNotifyList($member_srl);
|
||||
Rhymix\Framework\Cache::set($cache_key, $output);
|
||||
return $output->total_count;
|
||||
}
|
||||
|
||||
$args = new stdClass();
|
||||
$args->member_srl = $member_srl;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue