[wp-trac] [WordPress Trac] #44370: wp_privacy_delete_old_export_files runs too much on some setups

WordPress Trac noreply at wordpress.org
Thu Jun 14 14:38:32 UTC 2018


#44370: wp_privacy_delete_old_export_files runs too much on some setups
--------------------------+-----------------------------
 Reporter:  boonebgorges  |      Owner:  (none)
     Type:  enhancement   |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Privacy       |    Version:  4.9.6
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 The `wp_privacy_delete_old_export_files` cron job added in [43046] #43546
 runs on an hourly schedule. On large multisite networks, this means that
 these cleanup are running more or less constantly. Yet they're almost
 never needed.

 It's possible to write a plugin that modifies the behavior, by changing
 the way that scheduling is done so that it conforms better to the needs of
 a large network. However, I thought it might be worth considering whether
 there are changes that WP itself could make that would mitigate the
 problem for all installations. A few ideas, some of which are mutually
 compatible:

 1. Instead of scheduling the event on 'init', only schedule it when an
 export file is generated.
 2. During the cleanup routine, check for the existence of export files. If
 none are found, unschedule the recurring event (or don't schedule the next
 one)
 3. In combination with the above, use single events rather than recurring
 ones
 4. Perhaps the cleanup routine itself would be a single event, while a
 less-frequent (say, daily) recurring event would be to check whether
 specific cleanup events need to be scheduled (these would be cases missed
 by 1)

 If the team thinks this is too complex, or should be left up to the
 maintainer of the site in cases where it makes a difference, feel free to
 close the ticket.

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


More information about the wp-trac mailing list