Skip to content

Commit

Permalink
Save result in memory when successfully pulled from database
Browse files Browse the repository at this point in the history
  • Loading branch information
emisaacson committed Jan 22, 2016
1 parent b01f86b commit d394383
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Util/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ protected static function memoize($method_name) {
return $data;
}
if ($cache = cache_get($cache_name)) {
return $cache->data;
$data = $cache->data;
return $data;
}
$data = call_user_func_array(array(get_called_class(), $method_name), array());
cache_set($cache_name, $data);
Expand Down

0 comments on commit d394383

Please sign in to comment.