From 33660480609850cf47b39b5414e0d31e484b3cfb Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Sat, 22 Jun 2019 13:46:10 +1000 Subject: [PATCH] Add in utility function for resetting ACL and System Level Caches --- CRM/Core/BAO/Cache.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/CRM/Core/BAO/Cache.php b/CRM/Core/BAO/Cache.php index fe41bd06cc..ef2bc60eee 100644 --- a/CRM/Core/BAO/Cache.php +++ b/CRM/Core/BAO/Cache.php @@ -242,14 +242,22 @@ class CRM_Core_BAO_Cache extends CRM_Core_DAO_Cache { } if ($clearAll) { - // also reset ACL Cache - CRM_ACL_BAO_Cache::resetCache(); - - // also reset memory cache if any - CRM_Utils_System::flushCache(); + self::resetCaches(); } } + /** + * Cleanup ACL and System Level caches + */ + public static function resetCaches() { + // also reset ACL Cache + // @todo why is this called when CRM_Utils_System::flushCache() does it as well. + CRM_ACL_BAO_Cache::resetCache(); + + // also reset memory cache if any + CRM_Utils_System::flushCache(); + } + /** * The next two functions are internal functions used to store and retrieve session from * the database cache. This keeps the session to a limited size and allows us to -- 2.25.1