Skip to content

Commit

Permalink
Merge pull request #14600 from seamuslee001/util_function_for_resetti…
Browse files Browse the repository at this point in the history
…ng_ACL_System_cache

[REF] Add in utility function for resetting ACL and System Level Caches
  • Loading branch information
eileenmcnaughton authored Jun 22, 2019
2 parents d6e223e + 3366048 commit f1bde54
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions CRM/Core/BAO/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,22 @@ public static function deleteGroup($group = NULL, $path = NULL, $clearAll = TRUE
}

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
Expand Down

0 comments on commit f1bde54

Please sign in to comment.