From 971006b7a2ddf8315ed69c5a4a530da3d77d9b23 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Tue, 21 Jan 2014 17:16:26 +0100 Subject: [PATCH] [FIX] Live stats not being done with global cache Fixes live stats not updating and always using the global cache instead. --- public/include/classes/statistics.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/include/classes/statistics.class.php b/public/include/classes/statistics.class.php index 9cd3105a..4b91b4dd 100644 --- a/public/include/classes/statistics.class.php +++ b/public/include/classes/statistics.class.php @@ -501,7 +501,7 @@ class Statistics extends Base { public function getUserHashrate($account_id, $interval=180) { $this->debug->append("STA " . __METHOD__, 4); // Dual-caching, try statistics cron first, then fallback to local, then fallbock to SQL - if ($data = $this->memcache->getStatic(STATISTICS_ALL_USER_HASHRATES)) { + if ($this->getGetCache() && $data = $this->memcache->getStatic(STATISTICS_ALL_USER_HASHRATES)) { if (array_key_exists($account_id, $data['data'])) return $data['data'][$account_id]['hashrate']; // We have no cached value, we return defaults @@ -563,7 +563,7 @@ class Statistics extends Base { public function getUserShareDifficulty($account_id, $interval=180) { $this->debug->append("STA " . __METHOD__, 4); // Dual-caching, try statistics cron first, then fallback to local, then fallbock to SQL - if ($data = $this->memcache->getStatic(STATISTICS_ALL_USER_HASHRATES)) { + if ($this->getGetCache() && $data = $this->memcache->getStatic(STATISTICS_ALL_USER_HASHRATES)) { if (array_key_exists($account_id, $data['data'])) return $data['data'][$account_id]['avgsharediff']; // We have no cached value, we return defaults