From 085706321a94d45e1a126125025ae78a19796a5d Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Tue, 15 Oct 2013 02:40:58 +0200 Subject: [PATCH] Re-enable caching of the stats page --- htdocs/lib/Comments.php | 1 + htdocs/lib/CrashStats.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/lib/Comments.php b/htdocs/lib/Comments.php index e273fb8..07175a8 100644 --- a/htdocs/lib/Comments.php +++ b/htdocs/lib/Comments.php @@ -6,6 +6,7 @@ class Comments { $q = kl_str_sql("update signature set has_comments=(select count(*) as count from comment where signature_id=!i) where id=!i", $id, $id); DBH::$db->query($q); + Memc::flush(); } function addSignatureComment($id, $text) diff --git a/htdocs/lib/CrashStats.php b/htdocs/lib/CrashStats.php index 72426ac..a410bbe 100644 --- a/htdocs/lib/CrashStats.php +++ b/htdocs/lib/CrashStats.php @@ -27,7 +27,7 @@ class CrashStats $where = $this->filter->getWhere(); $q = "select count(r.id) as nr, s.id as signature_id, s.signature as signature_text, s.has_comments from reports r join signature s on r.signature_id = s.id $where group by signature_id order by nr desc"; $q .= kl_str_sql(" limit !i", 100); - // if (false !== $cached = Memc::getq($q)) return $cached; + if (false !== $cached = Memc::getq($q)) return $cached; if (!$res = DBH::$db->query($q)) { @@ -41,7 +41,7 @@ class CrashStats $ret[] = $r; } - // Memc::setq($q, $ret); + Memc::setq($q, $ret); return $ret; }