From 566b73fbfc8044c615ffd4de08df341758d4beff Mon Sep 17 00:00:00 2001 From: Mihail Geshoski Date: Fri, 3 Apr 2020 14:44:54 +0800 Subject: [PATCH] MDL-67594 core_lock: Deprecate extend() --- cache/upgrade.txt | 1 + lib/classes/lock/lock.php | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/cache/upgrade.txt b/cache/upgrade.txt index f367cad72b3..756307784c6 100644 --- a/cache/upgrade.txt +++ b/cache/upgrade.txt @@ -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 diff --git a/lib/classes/lock/lock.php b/lib/classes/lock/lock.php index 7b117c30ddc..f67083c83b4 100644 --- a/lib/classes/lock/lock.php +++ b/lib/classes/lock/lock.php @@ -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); } -- 2.43.0