[wp-hackers] Deleting a lot of posts/terms on plugin deactivation
wp-hackers at thecodecave.com
Mon Jul 1 17:18:52 UTC 2013
On 6/30/2013 2:28 PM, Matthias Breuer wrote:
>>> Yeah - I guess that this will be my choice at the end - just wanted to
>>> check if someone else has any better ideas.
>> Your best bet is to offload this onto wp-cron, which runs without a
>> timelimit (similar to CLI) in the background.
> I always thought wp-cron is running as a synchronous process when not called via real cronjobs. Is it done asynchronously?
Back in the 2.1 era or so you would have been correct. Back then,
whichever unlucky visitor triggered all the work was the one that got a
slow page load. Now, instead of processing cron directly, a separate
web call is made from the code using wp_remote_post() to trigger the
processing of a cron batch. That way all of the cron steps are executed
asynchronously to any the visitor's session.
More information about the wp-hackers