Skip to content

Commit

Permalink
Merge pull request #44 from emisaacson/fix-memoize
Browse files Browse the repository at this point in the history
Save result in memory when successfully pulled from database
  • Loading branch information
e0ipso committed Feb 7, 2016
2 parents b01f86b + d394383 commit 194fd5b
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 194fd5b

Please sign in to comment.