Automattic\WooCommerce\Internal\ProductFeed\Integrations\POSCatalog

AsyncGenerator::get_batch_time_limitprivateWC 1.0

Returns the per-batch PHP execution time limit (in seconds) for feed generation.

Method of the class: AsyncGenerator{}

Returns

Int. The per-batch time limit in seconds.

Usage

// private - for code of main (parent) class only
$result = $this->get_batch_time_limit(): int;

AsyncGenerator::get_batch_time_limit() code WC 11.0.0

private function get_batch_time_limit(): int {
	/**
	 * Filters the per-batch PHP execution time limit (in seconds) for product feed generation.
	 *
	 * The limit is set up front and reset after each processed batch, so a low `max_execution_time`
	 * does not abort generation part-way through a chunk. Return 0 to leave the time limit untouched.
	 * This only affects PHP's own execution timeout, not Action Scheduler's failure period nor any
	 * hard server/host request timeout.
	 *
	 * @param int $batch_time_limit The per-batch time limit in seconds.
	 *
	 * @since 11.0.0
	 */
	return (int) apply_filters( 'woocommerce_product_feed_batch_time_limit', 5 * MINUTE_IN_SECONDS );
}