wpsc_schedule_next_preload()
Schedule the next preload event without resetting the preload counter. This happens when the next loop of an active preload is scheduled.
No Hooks.
Returns
null. Nothing (null).
Usage
wpsc_schedule_next_preload();
wpsc_schedule_next_preload() wpsc schedule next preload code WPSCache 3.1.1
function wpsc_schedule_next_preload() {
global $cache_path;
/*
* Edge case: If preload is not active, don't schedule the next preload.
* This can happen if the preload is cancelled by the user right after a loop finishes.
*/
if ( ! wpsc_is_preload_active() ) {
wpsc_reset_preload_settings();
wp_cache_debug( 'wpsc_schedule_next_preload: preload is not active. not scheduling next preload.' );
return;
}
if ( defined( 'DOING_CRON' ) ) {
wp_cache_debug( 'wp_cron_preload_cache: scheduling the next preload in 3 seconds.' );
wp_schedule_single_event( time() + 3, 'wp_cache_preload_hook' );
}
// we always want to delete the mutex file, even if we're not using cron
$mutex = $cache_path . 'preload_mutex.tmp';
wp_delete_file( $mutex );
}