Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

LLMS_Processor_Course_Data::maybe_throttle( int $num_students )

For large courses, only recalculate once every 4 hours


Description Description


Parameters Parameters

$num_students

(int) (Required) number of students in the current course


Top ↑

Return Return

(boolean) true = throttle the current dispatch false = run the current dispatch


Top ↑

Source Source

File: includes/processors/class.llms.processor.course.data.php

	private function maybe_throttle( $num_students = 0 ) {

		// if we have more students in the course than the max allowed
		// we will only process this query once every four hours
		if ( $num_students >= $this->throttle_max_students ) {

			$last_run = $this->get_data( 'last_run' );

			return ( ( time() - $last_run ) <= $this->throttle_frequency );

		}

		return false;

	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.15.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.