Automattic\WooCommerce\Internal\BatchProcessing

BatchProcessingController::schedule_watchdog_action()privateWC 1.0

Schedule the watchdog action.

Method of the class: BatchProcessingController{}

Return

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->schedule_watchdog_action( $with_delay, $unique ): void;
$with_delay(true|false)
Whether to delay the action execution. Should be true when rescheduling, false when enqueueing.
Default: false
$unique(true|false)
Whether to make the action unique.
Default: false

BatchProcessingController::schedule_watchdog_action() code WC 8.6.1

private function schedule_watchdog_action( bool $with_delay = false, bool $unique = false ): void {
	$time = time();
	if ( $with_delay ) {
		/**
		 * Modify the delay interval for the batch processor's watchdog events.
		 *
		 * @since 8.2.0
		 *
		 * @param int $delay Time, in seconds, before the watchdog process will run. Defaults to 3600 (1 hour).
		 */
		$time += apply_filters( 'woocommerce_batch_processor_watchdog_delay_seconds', HOUR_IN_SECONDS );
	}

	if ( ! as_has_scheduled_action( self::WATCHDOG_ACTION_NAME ) ) {
		as_schedule_single_action(
			$time,
			self::WATCHDOG_ACTION_NAME,
			array(),
			self::ACTION_GROUP,
			$unique
		);
	}
}