WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#39828 closed defect (bug) (fixed)

Multiple do_pings events shouldn't be scheduled

Reported by: ethitter Owned by: SergeyBiryukov
Milestone: 4.8 Priority: normal
Severity: normal Version: 2.0.1
Component: Pings/Trackbacks Keywords:
Focuses: Cc:
PR Number:

Description

Whenever _publish_post_hook() is called, a new do_pings event is scheduled in wp-cron. Since do_all_pings() (the callback hooked to do_pings by default) takes no arguments, and pings everything that needs pinging each time it runs, there's no need to schedule multiple of these events.

The potential for duplicate events has existed since its introduction in r3663. As part of #6966, r9181 aimed to reduce duplicate events. If a site's cron is backlogged, however, that workaround will fail as it only looks ahead.

Attachments (1)

39828.diff (474 bytes) - added by ethitter 3 years ago.
Only schedule an event if one doesn't exist

Download all attachments as: .zip

Change History (3)

@ethitter
3 years ago

Only schedule an event if one doesn't exist

#1 @SergeyBiryukov
3 years ago

  • Milestone changed from Awaiting Review to 4.8

#2 @SergeyBiryukov
3 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 40054:

Pings/Trackbacks: Avoid scheduling multiple do_pings events in _publish_post_hook().

Props ethitter.
Fixes #39828.

Note: See TracTickets for help on using tickets.