Skip to content

Commit

Permalink
Disabled calling of stash_delete hook when cache pruning.
Browse files Browse the repository at this point in the history
  • Loading branch information
croxton committed Mar 13, 2015
1 parent 9e30363 commit 1de2e50
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ function delete_matching_keys($bundle_id = FALSE, $session_id=NULL, $site_id = 1
* @param integer $invalidate Delay until cached item expires (seconds)
* @return boolean
*/
protected function delete_cache($vars, $clear_static = TRUE, $invalidate = 0)
protected function delete_cache($vars, $clear_static = TRUE, $invalidate = 0, $call_hook = TRUE)
{
// get a list of variable ids
$ids = array();
Expand Down Expand Up @@ -443,7 +443,8 @@ protected function delete_cache($vars, $clear_static = TRUE, $invalidate = 0)
// -------------------------------------
// 'stash_delete' hook
// -------------------------------------
if ($this->EE->extensions->active_hook('stash_delete') === TRUE)
if ($this->EE->extensions->active_hook('stash_delete') === TRUE
&& $call_hook === TRUE)
{
$this->EE->extensions->call('stash_delete', array(
'key_name' => $row->key_name,
Expand Down Expand Up @@ -541,7 +542,7 @@ function prune_keys()

if ($query->num_rows() > 0)
{
if ($deleted = $this->delete_cache($query->result()))
if ($deleted = $this->delete_cache($query->result(), TRUE, 0, FALSE))
{
return TRUE;
}
Expand Down

0 comments on commit 1de2e50

Please sign in to comment.