[wp-trac] [WordPress Trac] #47223: Site Health Check: "last missed cron" test too aggressive

WordPress Trac noreply at wordpress.org
Fri May 10 20:49:56 UTC 2019


#47223: Site Health Check: "last missed cron" test too aggressive
----------------------------+-----------------------------
 Reporter:  DavidAnderson   |      Owner:  (none)
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Administration  |    Version:  5.2
 Severity:  normal          |   Keywords:
  Focuses:                  |
----------------------------+-----------------------------
 The `WP_Site_Health::has_missed_cron()` test will fail if there is a
 single cron event with a date more than 0 seconds in the past (the check
 done is `if ( ( $cron->time - time() ) < 0 ) {`). This is much too
 aggressive relative to the way that WP Cron works, relying upon incoming
 HTTP connections. A cron job running not at the precise time it was
 expected is normal *and documented* behaviour of WP Cron and not something
 to worry the user about (https://developer.wordpress.org/plugins/cron/ -
 "Though it may not run at a specific time, WP-Cron will get your tasks
 done in a timely manner").

 A more sensible test to indicate that your cron queue is under-serviced
 would be something like something 5 minutes overdue; that would indicate
 that the number of visits the cron system is getting isn't keeping up with
 the number of jobs. (You'll still see false positives in various
 situations; just, a lot less of them).

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/47223>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list