From 22d2cd57b308817566c82632c9276916b6ed7882 Mon Sep 17 00:00:00 2001 From: vnmedeiros Date: Thu, 9 May 2024 10:15:24 -0300 Subject: [PATCH] fix: set de lock duration BG process --- src/classes/libs/wp-background-process.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/classes/libs/wp-background-process.php b/src/classes/libs/wp-background-process.php index a9108964b..fb0b889f4 100644 --- a/src/classes/libs/wp-background-process.php +++ b/src/classes/libs/wp-background-process.php @@ -274,9 +274,10 @@ $this->debug('locking process: ' . $this->identifier); $this->start_time = time(); // Set start time of current process. $max_execution_time = ini_get('max_execution_time'); - $lock_duration = ( property_exists( $this, 'queue_lock_time' ) ) ? $this->queue_lock_time : ( empty($max_execution_time) ? 60 : ($max_execution_time * 1.5) ); // 1 minute + $lock_duration = ( property_exists( $this, 'queue_lock_time' ) && !empty($this->queue_lock_time) ) ? $this->queue_lock_time : ( empty($max_execution_time) ? 60 : ($max_execution_time * 1.5) ); // 1 minute $lock_duration = apply_filters( $this->identifier . '_queue_lock_time', $lock_duration ); $this->process_lock_in_time = microtime(); + $this->debug('locking duration: ' . $lock_duration); if(!$this->is_process_running()) set_site_transient( $this->identifier . '_process_lock', $this->process_lock_in_time, $lock_duration ); }