From 1d521e775fd420d05c17322c7613b626be256fac Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 29 Mar 2018 18:57:26 -0700 Subject: [PATCH] CRM_Utils_Cache_SqlGroup - Don't encourage infinite recursion The `deleteGroup(...$clearAll...)` option is heavy-handed and leads to call-paths that hard to grok. In the current design of CRM_Core_BAO_Cache (with multi-tier caching), one does need to clear these things. But let's not clear everything under the sun... --- CRM/Utils/Cache/SqlGroup.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CRM/Utils/Cache/SqlGroup.php b/CRM/Utils/Cache/SqlGroup.php index 6f3f45f792..0bb8e98e27 100644 --- a/CRM/Utils/Cache/SqlGroup.php +++ b/CRM/Utils/Cache/SqlGroup.php @@ -121,12 +121,16 @@ class CRM_Utils_Cache_SqlGroup implements CRM_Utils_Cache_Interface { * @param string $key */ public function delete($key) { - CRM_Core_BAO_Cache::deleteGroup($this->group, $key); + CRM_Core_BAO_Cache::deleteGroup($this->group, $key, FALSE); + CRM_Core_BAO_Cache::$_cache = NULL; // FIXME: remove multitier cache + CRM_Utils_Cache::singleton()->flush(); // FIXME: remove multitier cache unset($this->frontCache[$key]); } public function flush() { - CRM_Core_BAO_Cache::deleteGroup($this->group); + CRM_Core_BAO_Cache::deleteGroup($this->group, NULL, FALSE); + CRM_Core_BAO_Cache::$_cache = NULL; // FIXME: remove multitier cache + CRM_Utils_Cache::singleton()->flush(); // FIXME: remove multitier cache $this->frontCache = array(); } -- 2.25.1