Fix for ACTLOG caching

This commit is contained in:
Deon George 2012-12-12 15:19:17 +11:00
parent cf7f5256ae
commit 12a2a53ef7

View File

@ -125,13 +125,8 @@ class Model_NODE extends ORM_TSM {
$c = Kohana::$config->load('config')->cache;
if (is_null($result = Cache::instance($c)->get($k))) {
$result = array();
// In the interest of performance, we load all the records and get PHP to process it.
// Our ORM caching we reduce the hit on TSM.
foreach (ORM::factory('ACTLOG')->find_all() as $o)
if ($o->NODENAME == $this->NODE_NAME)
array_push($result,$o);
// We cant load all records here, like we do with the others, there is too much data!
$result = $this->ACTLOG->find_all();
// @todo Cache time should be configurble
Cache::instance($c)->set($k,$result,300);