MDL-67594 core_lock: Deprecate extend()

This commit is contained in:
Mihail Geshoski 2020-04-03 14:44:54 +08:00
parent 80736a93aa
commit 566b73fbfc
2 changed files with 6 additions and 0 deletions

1
cache/upgrade.txt vendored
View File

@ -5,6 +5,7 @@ Information provided here is intended especially for developers.
* The function supports_recursion() from the lock_factory interface has been deprecated including the related implementations.
* The function extend_lock() from the lock_factory interface has been deprecated without replacement including the related
implementations.
* The function extend() from the lock class has been deprecated without replacement.
=== 3.9 ===
* The record_cache_hit/miss/set methods now take a cache_store instead of a cache_definition object

View File

@ -80,10 +80,15 @@ class lock {
/**
* Extend the lifetime of this lock. Not supported by all factories.
*
* @deprecated since Moodle 4.0.
* @param int $maxlifetime - the new lifetime for the lock (in seconds).
* @return bool
*/
public function extend($maxlifetime = 86400) {
debugging('The function extend() is deprecated, please do not use it anymore.',
DEBUG_DEVELOPER);
if ($this->factory) {
return $this->factory->extend_lock($this, $maxlifetime);
}