MDL-67020 Cache: Make locking work for local file caches

* Add new requirelockingbeforewrite flag for cache definitions
* Implement native locking in cachestore_file (leveraging
file_lock_factory).
This commit is contained in:
Mark Johnson
2022-10-20 11:31:33 +01:00
parent dcc7d7b8df
commit 045ee091da
12 changed files with 328 additions and 27 deletions
+20
View File
@@ -200,6 +200,26 @@ class cache_disabled extends cache {
public function purge() {
return true;
}
/**
* Pretend that we got a lock to avoid errors.
*
* @param string $key
* @return bool
*/
public function acquire_lock(string $key) : bool {
return true;
}
/**
* Pretend that we released a lock to avoid errors.
*
* @param string $key
* @return void
*/
public function release_lock(string $key) : bool {
return true;
}
}
/**