Usage_Reports::async_report()

async_report


Return Return

(string)


Source Source

File: src/core/classes/class-usage-reports.php

	public function async_report() {

		$next_report = time() + $this->retry_interval;
		// Update the option early to prevent multiple simultaneous calls
		update_option( 'automator_next_report', $next_report );

		$url = get_rest_url() . 'uap/v2/async_report/';

		// Call the endpoint to make sure that the process runs at the background
		$response = wp_remote_post(
			$url,
			array(
				'timeout'   => 0.01,
				'blocking'  => false,
				'body'      => array(
					'next_report' => $next_report,
				),

			)
		);

		return $url;
	}