Opened 12 years ago
Last modified 3 years ago
#28635 reopened feature request
Add status codes and hooks to wp-cron.php
| Reported by: | westonruter | Owned by: | chriscct7 |
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Cron API | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
Description
I've been debugging a site problem which turned out to be one of the cron actions resulting in a memory limit breach, and so PHP did a fatal error in the middle of the cron loop. (It's a high-traffic site so it has DISABLE_WP_CRON with system cron pinging wp-cron.php every minute.) There is currently very little debugging hooks provided in wp-cron.php to help diagnose why and where a scheduled event hook is failing.
Some ideas for how wp-cron.php could be improved to facilitate debugging (and also to help with general logging):
- Return a status message pinpointing at which point
wp-cron.phpexited - Return relevant HTTP status codes
- Allow
diebehavior to be overridden, similarly to howwp_die()is used elsewhere - Add hooks before before and after each level in the triple-nested crons loop.
Attachments (3)
Change History (9)
#2
@
11 years ago
- Keywords needs-refresh removed
The patch has been refreshed against the latest trunk. I've also went through and documented the various parts that had @todo docs in the comments.
I recently submitted a new patch for #18471 but I believe this same ticket is related and accomplishes the task better.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Echo status codes from
wp-cron.php. Use_ajax_wp_die_handlerforDOING_CRONtoo. Introduce filterablewp_cron_exit_handlerwith HTTP status codes. Add hooks for cron loops. Commits:https://github.com/x-team/wordpress-develop/compare/master...d6450f9 PR: https://github.com/x-team/wordpress-develop/pull/21