WP_Background_Process::lock_process()protectedWC 1.0

Lock process

Lock the process so that multiple instances can't run simultaneously. Override if applicable, but the duration should be greater than that defined in the time_exceeded() method.

Метод класса: WP_Background_Process{}

Хуки из метода

Возвращает

null. Ничего (null).

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->lock_process();

Код WP_Background_Process::lock_process() WC 9.3.3

protected function lock_process() {
	$this->start_time = time(); // Set start time of current process.

	$lock_duration = ( property_exists( $this, 'queue_lock_time' ) ) ? $this->queue_lock_time : 60; // 1 minute
	$lock_duration = apply_filters( $this->identifier . '_queue_lock_time', $lock_duration );

	set_site_transient( $this->identifier . '_process_lock', microtime(), $lock_duration );
}