And then, if there are 1000 things in the queue, what does it do? Are the queue entries all "deliver asap" or can I schedule things for the future?
And then, if there are 1000 things in the queue, what does it do? Are the queue entries all "deliver asap" or can I schedule things for the future?
Alternatively you can use curl
*/10 * * * * curl http://example.com/wp-cron.php > /dev/null 2>&1
And disable the cron in wp-config.php:
define('DISABLE_WP_CRON', true);
My use case is non-standard 😄 For FediTest.org, I'd like to deliver outgoing ActivityPub messages asap, so my tests don't take longer than necessary. I've attempted to invoke wp-cron.php manually but it's not sending immediately ... 15 times with 1 sec delay often works, but not always. As soon as I open any page in the browser, it goes through, however. It's the unpredictability that I'm trying to understand ...
| activitypub_update_followers | 2024-10-15 22:57:27 | 58 minutes 35 seconds | 1 hour |
| activitypub_cleanup_followers | 2024-10-16 21:57:27 | 23 hours 58 minutes | 1 day |
It seems most likely that it's putting these requests into a queue which then gets handled by an hourly event. So manually calling wp-cron won't make it happen any faster.
If your site is (really) high traffic or the job you want to run requires a specific timing, then maybe you should look at something else.
But again, for the normal reasons you want to use wp-cron, it works perfectly fine, by just leaving it alone.
If you describe your use case, then I can give you more information on the right way to do it, because yes, I know exactly how it works. However, explaining it is... convoluted.
It runs in the background though so doesn’t hold up requests, which is why it’s spawned at the end of other requests.
Because web requests have a limited execution time it’s better to turn off the regular HTTP-invoked cron and run WP-cron from a system cron.
Does that make sense? Too technical? Other questions?
I can probably help you out with understanding this if needed, email me some info about it: otto at wordpress.org
Trouble is the only queuing solution I know runs off of wp-cron!
https://github.com/deliciousbrains/wp-queue
Do you know what cron event your sending is hooked onto?