Index: trunk/extensions/FlaggedRevs/FRCacheUpdate.php |
— | — | @@ -8,7 +8,7 @@ |
9 | 9 | public $mTitle, $mTable; |
10 | 10 | public $mRowsPerJob, $mRowsPerQuery; |
11 | 11 | |
12 | | - public function __construct( $titleTo ) { |
| 12 | + public function __construct( Title $titleTo ) { |
13 | 13 | global $wgUpdateRowsPerJob, $wgUpdateRowsPerQuery; |
14 | 14 | $this->mTitle = $titleTo; |
15 | 15 | $this->mTable = 'flaggedrevs_tracking'; |
— | — | @@ -22,12 +22,14 @@ |
23 | 23 | $wgFlaggedRevsCacheUpdates = array(); // temp var |
24 | 24 | } |
25 | 25 | $key = $this->mTitle->getPrefixedDBKey(); |
26 | | - if ( isset( $wgFlaggedRevsCacheUpdates[$key] ) ) |
| 26 | + if ( isset( $wgFlaggedRevsCacheUpdates[$key] ) ) { |
27 | 27 | return; // No duplicates... |
| 28 | + } |
28 | 29 | # Fetch the IDs |
29 | 30 | $dbr = wfGetDB( DB_SLAVE ); |
30 | 31 | $res = $dbr->select( $this->mTable, $this->getFromField(), |
31 | 32 | $this->getToCondition(), __METHOD__ ); |
| 33 | + # Check if there is anything to do... |
32 | 34 | if ( $dbr->numRows( $res ) > 0 ) { |
33 | 35 | # Do it right now? |
34 | 36 | if ( $dbr->numRows( $res ) <= $this->mRowsPerJob ) { |
— | — | @@ -86,7 +88,7 @@ |
87 | 89 | return array( 'ftr_namespace' => $this->mTitle->getNamespace(), |
88 | 90 | 'ftr_title' => $this->mTitle->getDBkey() ); |
89 | 91 | } |
90 | | - |
| 92 | + |
91 | 93 | /** |
92 | 94 | * Invalidate a set of IDs, right now |
93 | 95 | */ |
— | — | @@ -164,7 +166,6 @@ |
165 | 167 | if ( $this->end ) { |
166 | 168 | $conds[] = "$fromField <= {$this->end}"; |
167 | 169 | } |
168 | | - |
169 | 170 | # Run query to get page Ids |
170 | 171 | $dbr = wfGetDB( DB_SLAVE ); |
171 | 172 | $res = $dbr->select( $this->table, $fromField, $conds, __METHOD__ ); |