Skip to:

Opened 6 years ago

Last modified 6 years ago

#7904 new defect (bug)

Akismet cleanup cron job should not be scheduled on secondary sites

Reported by: boonebgorges's profile boonebgorges Owned by:
Milestone: Awaiting Contributions Priority: normal
Severity: normal Version:
Component: Activity Keywords: needs-patch good-first-bug


Currently, it's possible for BP_Akismet::check_activity() to run on a non-root blog (as in the case of blog comments). This triggers send_akismet_request(), and at the end of that method, there's a call to wp_schedule_event(). As a result, the metadata-cleanup routine bp_activity_akismet_delete_old_metadata can get scheduled across many sites in the network. This is unnecessary.

I think the right technique is probably to switch to the root blog before scheduling the event.

Change History (2)

#1 @DJPaul
6 years ago

If multiblog is set, then I think that means it has to run everywhere.

In a multisite where BuddyPress is listening to the entire network, hoovering up content into its activity stream, then as the activity items only get created on that root site, then yes, it only needs to run there. Good spot.

#2 @DJPaul
6 years ago

  • Milestone changed from 4.0 to Awaiting Contributions
Note: See TracTickets for help on using tickets.