Verified Commit 0235f0ae authored by Erick Hitter's avatar Erick Hitter
Browse files

Fix method's implementation so that expiration matches that of rest of class

Setting one in minutes and the rest in seconds is just going to cause issues, such as in f21fdc8d.
parent f21fdc8d
......@@ -5,12 +5,16 @@ namespace Automattic\WP\Cron_Control;
class Lock {
/**
* Set a lock and limit how many concurrent jobs are permitted
*
* @param $lock string Lock name
* @param $limit int Concurrency limit
* @param $timeout int Timeout in seconds
*
* @return bool
*/
public static function check_lock( $lock, $limit = null, $timeout_in_minutes = null ) {
public static function check_lock( $lock, $limit = null, $timeout = null ) {
// Timeout, should a process die before its lock is freed
if ( is_numeric( $timeout_in_minutes ) ) {
$timeout = $timeout_in_minutes * \MINUTE_IN_SECONDS;
} else {
if ( ! is_numeric( $timeout ) ) {
$timeout = LOCK_DEFULT_TIMEOUT_IN_MINUTES * \MINUTE_IN_SECONDS;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment