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; $c = Kohana::$config->load('config')->cache;
if (is_null($result = Cache::instance($c)->get($k))) { if (is_null($result = Cache::instance($c)->get($k))) {
$result = array(); // We cant load all records here, like we do with the others, there is too much data!
$result = $this->ACTLOG->find_all();
// 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);
// @todo Cache time should be configurble // @todo Cache time should be configurble
Cache::instance($c)->set($k,$result,300); Cache::instance($c)->set($k,$result,300);