ActionScheduler_Abstract_QueueRunner::get_memory_limit()protectedWC 1.0

Get memory limit

Based on WP_Background_Process::get_memory_limit()

Method of the class: ActionScheduler_Abstract_QueueRunner{}

No Hooks.

Return

Int.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_memory_limit();

ActionScheduler_Abstract_QueueRunner::get_memory_limit() code WC 9.3.1

protected function get_memory_limit() {
	if ( function_exists( 'ini_get' ) ) {
		$memory_limit = ini_get( 'memory_limit' );
	} else {
		$memory_limit = '128M'; // Sensible default, and minimum required by WooCommerce
	}

	if ( ! $memory_limit || -1 === $memory_limit || '-1' === $memory_limit ) {
		// Unlimited, set to 32GB.
		$memory_limit = '32G';
	}

	return ActionScheduler_Compatibility::convert_hr_to_bytes( $memory_limit );
}