WordPress.org

Plugin Directory

Changeset 440843 for feedwordpress


Ignore:
Timestamp:
09/20/11 15:06:07 (6 years ago)
Author:
radgeek
Message:

Make max_polls at least minimally responsive to number of feeds a user has, instead of fixed =10.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • feedwordpress/trunk/feedwordpress.php

    r431210 r440843  
    10031003            $crash_ts = $this->crash_ts(); 
    10041004        endif; 
    1005  
    1006         $max_polls = apply_filters('feedwordpress_polls_per_update', get_option('feedwordpress_polls_per_update', 10), $uri); 
    10071005         
    10081006        // Randomize order for load balancing purposes 
    10091007        $feed_set = $this->feeds; 
    10101008        shuffle($feed_set); 
     1009 
     1010        $updateWindow = (int) get_option('feedwordpress_update_window', DEFAULT_UPDATE_PERIOD) * 60 /* sec/min */; 
     1011        $interval = (int) get_option('feedwordpress_freshness', FEEDWORDPRSS_FRESHNESS_INTERVAL); 
     1012        $portion = max( 
     1013            ceil(count($feed_set) / ($updateWindow / $interval)), 
     1014            10 
     1015        ); 
     1016         
     1017        $max_polls = apply_filters('feedwordpress_polls_per_update', get_option( 
     1018            'feedwordpress_polls_per_update',   $portion 
     1019        ), $uri); 
     1020         
    10111021 
    10121022        $feed_set = apply_filters('feedwordpress_update_feeds', $feed_set, $uri); 
Note: See TracChangeset for help on using the changeset viewer.