From 12a2a53ef7d16f1d8836cbc95be669e4733ca7d6 Mon Sep 17 00:00:00 2001 From: Deon George Date: Wed, 12 Dec 2012 15:19:17 +1100 Subject: [PATCH] Fix for ACTLOG caching --- application/classes/Model/NODE.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/application/classes/Model/NODE.php b/application/classes/Model/NODE.php index 3abf742..eff6320 100644 --- a/application/classes/Model/NODE.php +++ b/application/classes/Model/NODE.php @@ -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);