Automatically fill cache in ncenterliteModel->_getNewCount()

285ea8a 보완

카운트 캐시가 없는 경우 자동으로 캐시를 생성하도록 변경함.
푸시앱 등 알림 내용은 안 불러오고 카운트만 받아가는 경우가 있어서
이렇게 하지 않으면 반복 호출해도 캐시 효과가 없음.

푸시앱 사용자가 많고 알림이 수천~수만 개씩 쌓이는 사이트에서
이 패치 적용 후 DB서버 부하가 50% 이상 줄어들었음.
This commit is contained in:
Kijin Sung 2018-01-16 23:36:37 +09:00
parent 285ea8a8ed
commit c9d3645f10

View file

@ -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;