Making WordPress.org


Ignore:
Timestamp:
09/02/2020 04:41:58 AM (5 years ago)
Author:
dd32
Message:

Plugin Directory: Jobs: Meta Sync: Run the sync twice hourly, and only sync download counts that have changed more than 10.

This is a performance boost for the ElasticSearch syncing which can have many thousands of plugins updating the download count by 1 every hour, which slows down indexing for everything else.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/jobs/class-meta-sync.php

    r9285 r10230  
    4141            "SELECT p.id as post_id, downloads
    4242            FROM `{$wpdb->posts}` p
    43                 JOIN `{$download_count_table}` c on p.post_name = c.plugin_slug
     43                JOIN `{$download_count_table}` c ON p.post_name = c.plugin_slug
    4444                LEFT JOIN `{$wpdb->postmeta}` pm ON p.id = pm.post_id AND pm.meta_key = 'downloads'
    4545
    4646            WHERE
    47                 downloads != pm.meta_value OR
    48                 pm.meta_id IS NULL"
     47                pm.meta_id IS NULL
     48                OR
     49                downloads - pm.meta_value > 10
     50            "
    4951        );
    5052
Note: See TracChangeset for help on using the changeset viewer.