Automattic\WooCommerce\Internal\StockNotifications\AsyncTasks

CycleStateService::complete_cycle │ public │ WC 1.0

Complete the cycle.

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

Хуков нет.

Возвращает

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

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

$CycleStateService = new CycleStateService();
$CycleStateService->complete_cycle( $product_id, $cycle_state ): void;
$product_id(int|строка) (обязательный)
The product ID.
$cycle_state(массив) (обязательный)
The cycle state.

Код CycleStateService::complete_cycle() WC 11.2.2

public function complete_cycle( int $product_id, array $cycle_state ): void {

	$cycle_state['duration'] = time() - $cycle_state['cycle_start_time'];

	$this->logger->info(
		sprintf( 'Completed cycle for product %d. Sent: %d, Skipped: %d, Failed: %d, Duration: %d seconds. Total notifications processed: %d', $product_id, $cycle_state['sent_count'], $cycle_state['skipped_count'], $cycle_state['failed_count'], $cycle_state['duration'], $cycle_state['total_count'] ),
		array( 'source' => 'wc-customer-stock-notifications' )
	);

	$this->save_cycle_state( $product_id, array() );
}