[wp-trac] [WordPress Trac] #33681: taxonomy.php in _wp_check_for_scheduled_split_terms calls wp_schedule_single_event in wrong parameters order
WordPress Trac
noreply at wordpress.org
Wed Sep 2 14:16:48 UTC 2015
#33681: taxonomy.php in _wp_check_for_scheduled_split_terms calls
wp_schedule_single_event in wrong parameters order
--------------------------+-----------------------------
Reporter: aalmenar | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 4.3
Severity: normal | Keywords:
Focuses: performance |
--------------------------+-----------------------------
I had a problem on a wordpress installation that cron was getting filled
(10MB in one record) with a lot of single execution of crons.
After discovering that single execution crons get added using
wp_schedule_single_event( $timestamp, $hook, $args = array()), i found
that taxonomy.php on version 4.3 has a change that keeps adding the same
cron without empty arguments and with a hook of the current timestamp.
I made a change on this file (taxonomy.php) and now my cron on options
table doesnt get filled.
function _wp_check_for_scheduled_split_terms() {
if ( ! get_option( 'finished_splitting_shared_terms' ) && !
wp_next_scheduled( 'wp_batch_split_terms' ) ) {
(Removed) //wp_schedule_single_event( 'wp_batch_split_terms', time() +
MINUTE_IN_SECONDS );
(Added) wp_schedule_single_event( time() + MINUTE_IN_SECONDS,
'wp_batch_split_terms' );
}
}
wp_schedule_single_event had parameters in the wrong order making the cron
addition without any valid hooks but the timestamp.
Now performance problems and issues with database are gone.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33681>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list