You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Deleting all events with a given hook via wp cron event unschedule <hook> or wp_unschedule_hook( <hook> ) will only delete a maximum of 100 events. If there are more than 100 events with that hook then the remainder will not be deleted and the command will need to be run multiple times.
This problem was identified on a site with a runaway process that had scheduled thousands of events with the same hook name but different parameters. Unscheduling the events only unscheduled 100 at a time.
The fix would be to either repeat this query in a loop until there are no more matches, or to remove the limit on the query, although the latter risks exhausting memory if there's an exceptionally high number of jobs with that hook.
The text was updated successfully, but these errors were encountered:
Deleting all events with a given hook via
wp cron event unschedule <hook>
orwp_unschedule_hook( <hook> )
will only delete a maximum of 100 events. If there are more than 100 events with that hook then the remainder will not be deleted and the command will need to be run multiple times.This problem was identified on a site with a runaway process that had scheduled thousands of events with the same hook name but different parameters. Unscheduling the events only unscheduled 100 at a time.
This is caused by the
\HM\Cavalcade\Plugin\Connector\pre_clear_scheduled_hook
function that's hooked intopre_clear_scheduled_hook
which queries for a maximum of 100 jobs.The fix would be to either repeat this query in a loop until there are no more matches, or to remove the
limit
on the query, although the latter risks exhausting memory if there's an exceptionally high number of jobs with that hook.The text was updated successfully, but these errors were encountered: