Skip to content

Commit

Permalink
Merge pull request #23624 from mattwire/sqlgroup
Browse files Browse the repository at this point in the history
Release lock when deleting cache key
  • Loading branch information
seamuslee001 authored May 29, 2022
2 parents d2256e5 + efa121e commit ee35b88
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CRM/Utils/Cache/SqlGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ public function set($key, $value, $ttl = NULL) {
}

if (is_int($ttl) && $ttl <= 0) {
return $this->delete($key);
$result = $this->delete($key);
$lock->release();
return $result;
}

$dataExists = CRM_Core_DAO::singleValueQuery("SELECT COUNT(*) FROM {$this->table} WHERE {$this->where($key)}");
Expand Down

0 comments on commit ee35b88

Please sign in to comment.