From 22e8d0e0e5ceefa94ece3d7014ee8962dbdbbb16 Mon Sep 17 00:00:00 2001 From: azaozz Date: Sat, 31 Jan 2009 02:23:24 +0000 Subject: [PATCH] Spawn cron with AJAX request, see #9005 git-svn-id: http://svn.automattic.com/wordpress/trunk@10474 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/cron.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/wp-includes/cron.php b/wp-includes/cron.php index 3a39de474..1f72e4f7f 100644 --- a/wp-includes/cron.php +++ b/wp-includes/cron.php @@ -180,7 +180,6 @@ function spawn_cron( $local_time ) { if ( $timestamp > $local_time ) return; - $cron_url = get_option( 'siteurl' ) . '/wp-cron.php'; /* * multiple processes on multiple web servers can run this code concurrently * try to make this as atomic as possible by setting doing_cron switch @@ -201,7 +200,7 @@ function spawn_cron( $local_time ) { update_option( 'doing_cron', $local_time + 30 ); - wp_remote_post($cron_url, array('timeout' => 0.01, 'blocking' => false)); + add_action('wp_head', 'spawn_cron_request'); } /** @@ -371,4 +370,14 @@ function check_server_timer( $local_time ) { return true; } +function spawn_cron_request() { +?> + +