WordPress.org

Make WordPress Core

Opened 8 months ago

#49866 new enhancement

Create pre and post actions for wp-cron jobs

Reported by: nishisan Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.4
Component: Cron API Keywords: has-patch needs-testing
Focuses: performance Cc:

Description

Some times its dificult to track jobs that impacts in server and db performance within wp-cron. This patch, creates two new hooks: pre_wp_cron_run and post_wp_cron_run.

Eventually a plugin development to track jobs can easily be implemented:

Bellow a conceptual log file from the conceptual plugin

09-04-2020 20:28:00.254607 - [DEBUG] - Cron Job Activated: [action_scheduler_run_queue] 2fa91486-91ce-4678-a2e1-4bff02340952
09-04-2020 20:28:00.294418 - [DEBUG] - Cron Job Terminated: [action_scheduler_run_queue] 2fa91486-91ce-4678-a2e1-4bff02340952

Attachments (1)

wp-cron.php.patch (1.3 KB) - added by nishisan 8 months ago.
wp-cron.php Patch for new hooks

Download all attachments as: .zip

Change History (1)

@nishisan
8 months ago

wp-cron.php Patch for new hooks

Note: See TracTickets for help on using tickets.