Timeline for How to make sure a wp-cron job runs
Current License: CC BY-SA 3.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 26, 2014 at 12:22 | comment | added | Otto | Using init and checking every time makes every page slow. Also, doing your work in the same process means that visitor has to wait until you're done. wp-cron runs asyncronously, the user that triggered it has no slowdown. | |
Apr 26, 2014 at 10:18 | comment | added | sun |
Hi Otto, i have a doubt. Why not use init hook so every time user visits we'll check the time and do whatever we want instead of cron as cron too works on page visits. What is the advantage in cron then other regular hook which gets executed on page visits like wp_head . @Otto
|
|
Sep 1, 2012 at 4:22 | comment | added | Otto | No, because nobody might visit your site. :) It will probably run. That's the best anybody can say. If you need guarantees, use a real cron job instead. | |
Sep 1, 2012 at 2:13 | vote | accept | fdsa | ||
Sep 1, 2012 at 2:13 | comment | added | fdsa | @Otto So if I have stuff running in the wp-cron I can be assured that it will run eventually? | |
Aug 30, 2012 at 17:55 | comment | added | Otto | All jobs run, but not necessarily at once. PHP on websites typically has a 30 second timeout, if the total job queue takes longer than that, it may get deferred to the next hit. | |
Aug 30, 2012 at 17:03 | comment | added | kaiser | Thanks for clarifying #3. +1 Question: Will all jobs run, when the time was missed, or just the last one? | |
Aug 30, 2012 at 11:35 | history | answered | Otto | CC BY-SA 3.0 |