mirror of
https://github.com/moodle/moodle.git
synced 2025-05-02 14:28:30 +02:00
MDL-76865 core: Check lock state before attempting to acquire a lock
This commit is contained in:
parent
478abd671f
commit
af91ae626a
3
cache/classes/loaders.php
vendored
3
cache/classes/loaders.php
vendored
@ -621,7 +621,8 @@ class cache implements cache_loader {
|
|||||||
// store; parent method will have set it to all stores if needed.
|
// store; parent method will have set it to all stores if needed.
|
||||||
if ($setaftervalidation) {
|
if ($setaftervalidation) {
|
||||||
$lock = null;
|
$lock = null;
|
||||||
if (!empty($this->requirelockingbeforewrite)) {
|
// Only try to acquire a lock for this cache if we do not already have one.
|
||||||
|
if (!empty($this->requirelockingbeforewrite) && !$this->check_lock_state($key)) {
|
||||||
$lock = $this->acquire_lock($key);
|
$lock = $this->acquire_lock($key);
|
||||||
}
|
}
|
||||||
if ($requiredversion === self::VERSION_NONE) {
|
if ($requiredversion === self::VERSION_NONE) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user