MDL-67594 core_lock: Deprecate extend_lock()
This commit is contained in:
Vendored
+2
@@ -3,6 +3,8 @@ Information provided here is intended especially for developers.
|
||||
|
||||
=== 4.0 ===
|
||||
* 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.
|
||||
|
||||
=== 3.9 ===
|
||||
* The record_cache_hit/miss/set methods now take a cache_store instead of a cache_definition object
|
||||
|
||||
@@ -191,11 +191,16 @@ class db_record_lock_factory implements lock_factory {
|
||||
|
||||
/**
|
||||
* Extend a lock that was previously obtained with @lock.
|
||||
*
|
||||
* @deprecated since Moodle 4.0.
|
||||
* @param lock $lock - a lock obtained from this factory.
|
||||
* @param int $maxlifetime - the new lifetime for the lock (in seconds).
|
||||
* @return boolean - true if the lock was extended.
|
||||
*/
|
||||
public function extend_lock(lock $lock, $maxlifetime = 86400) {
|
||||
debugging('The function extend_lock() is deprecated, please do not use it anymore.',
|
||||
DEBUG_DEVELOPER);
|
||||
|
||||
$now = time();
|
||||
$expires = $now + $maxlifetime;
|
||||
$params = array('expires' => $expires,
|
||||
|
||||
@@ -192,11 +192,15 @@ class file_lock_factory implements lock_factory {
|
||||
|
||||
/**
|
||||
* Extend a lock that was previously obtained with @lock.
|
||||
*
|
||||
* @deprecated since Moodle 4.0.
|
||||
* @param lock $lock - not used
|
||||
* @param int $maxlifetime - not used
|
||||
* @return boolean - true if the lock was extended.
|
||||
*/
|
||||
public function extend_lock(lock $lock, $maxlifetime = 86400) {
|
||||
debugging('The function extend_lock() is deprecated, please do not use it anymore.',
|
||||
DEBUG_DEVELOPER);
|
||||
// Not supported by this factory.
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -118,11 +118,14 @@ class installation_lock_factory implements lock_factory {
|
||||
/**
|
||||
* Extend a lock that was previously obtained with @lock.
|
||||
*
|
||||
* @deprecated since Moodle 4.0.
|
||||
* @param lock $lock - not used
|
||||
* @param int $maxlifetime - not used
|
||||
* @return boolean - true if the lock was extended.
|
||||
*/
|
||||
public function extend_lock(lock $lock, $maxlifetime = 86400) {
|
||||
debugging('The function extend_lock() is deprecated, please do not use it anymore.',
|
||||
DEBUG_DEVELOPER);
|
||||
// Not supported by this factory.
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -99,6 +99,7 @@ interface lock_factory {
|
||||
/**
|
||||
* Extend the timeout on a held lock.
|
||||
*
|
||||
* @deprecated since Moodle 4.0.
|
||||
* @param lock $lock - lock obtained from this factory
|
||||
* @param int $maxlifetime - new max time to hold the lock
|
||||
* @return boolean - True if the lock was extended.
|
||||
|
||||
@@ -168,11 +168,15 @@ class mysql_lock_factory implements lock_factory {
|
||||
|
||||
/**
|
||||
* Extend a lock that was previously obtained with @lock.
|
||||
*
|
||||
* @deprecated since Moodle 4.0.
|
||||
* @param lock $lock - a lock obtained from this factory.
|
||||
* @param int $maxlifetime - the new lifetime for the lock (in seconds).
|
||||
* @return boolean - true if the lock was extended.
|
||||
*/
|
||||
public function extend_lock(lock $lock, $maxlifetime = 86400) {
|
||||
debugging('The function extend_lock() is deprecated, please do not use it anymore.',
|
||||
DEBUG_DEVELOPER);
|
||||
// Not supported by this factory.
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -198,11 +198,15 @@ class postgres_lock_factory implements lock_factory {
|
||||
|
||||
/**
|
||||
* Extend a lock that was previously obtained with @lock.
|
||||
*
|
||||
* @deprecated since Moodle 4.0.
|
||||
* @param lock $lock - a lock obtained from this factory.
|
||||
* @param int $maxlifetime - the new lifetime for the lock (in seconds).
|
||||
* @return boolean - true if the lock was extended.
|
||||
*/
|
||||
public function extend_lock(lock $lock, $maxlifetime = 86400) {
|
||||
debugging('The function extend_lock() is deprecated, please do not use it anymore.',
|
||||
DEBUG_DEVELOPER);
|
||||
// Not supported by this factory.
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user