Skip to content

Commit

Permalink
MDL-67594 core_lock: Deprecate extend()
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihail Geshoski committed Jul 6, 2020
1 parent 80736a9 commit 566b73f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions cache/upgrade.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions lib/classes/lock/lock.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,15 @@ public function get_key() {

/**
* 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);
}
Expand Down

0 comments on commit 566b73f

Please sign in to comment.