Skip to content

Commit

Permalink
CRM_Utils_Cache_SqlGroup - Don't encourage infinite recursion
Browse files Browse the repository at this point in the history
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...
  • Loading branch information
totten committed Jun 19, 2018
1 parent 5aac553 commit 1d521e7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions CRM/Utils/Cache/SqlGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,16 @@ public function getFromFrontCache($key, $default = NULL) {
* @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();
}

Expand Down

0 comments on commit 1d521e7

Please sign in to comment.