Index: trunk/extensions/FlaggedRevs/FRCacheUpdate.php |
— | — | @@ -196,6 +196,8 @@ |
197 | 197 | # Invalidate caches of articles which include this page |
198 | 198 | $update = new HTMLCacheUpdate( $this->title, 'templatelinks' ); |
199 | 199 | $update->doUpdate(); |
| 200 | + $update = new HTMLCacheUpdate( $this->title, 'imagelinks' ); |
| 201 | + $update->doUpdate(); |
200 | 202 | } |
201 | 203 | } |
202 | 204 | } |
Index: trunk/extensions/FlaggedRevs/FRDependencyUpdate.php |
— | — | @@ -59,25 +59,31 @@ |
60 | 60 | } |
61 | 61 | # Get any dependency tracking changes |
62 | 62 | $existing = $this->getExistingDeps(); |
63 | | - $insertions = $this->getDepInsertions( $existing, $deps ); |
64 | | - $deletions = $this->getDepDeletions( $existing, $deps ); |
65 | | - # Delete removed links |
66 | | - if ( $deletions ) { |
67 | | - $this->dbw->delete( 'flaggedrevs_tracking', $deletions, __METHOD__ ); |
| 63 | + # Do incremental updates... |
| 64 | + if ( $existing != $deps ) { |
| 65 | + $existing = $this->getExistingDeps( FR_MASTER ); |
| 66 | + $insertions = $this->getDepInsertions( $existing, $deps ); |
| 67 | + $deletions = $this->getDepDeletions( $existing, $deps ); |
| 68 | + # Delete removed links |
| 69 | + if ( $deletions ) { |
| 70 | + $this->dbw->delete( 'flaggedrevs_tracking', $deletions, __METHOD__ ); |
| 71 | + } |
| 72 | + # Add any new links |
| 73 | + if ( $insertions ) { |
| 74 | + $this->dbw->insert( 'flaggedrevs_tracking', $insertions, __METHOD__, 'IGNORE' ); |
| 75 | + } |
68 | 76 | } |
69 | | - # Add any new links |
70 | | - if ( $insertions ) { |
71 | | - $this->dbw->insert( 'flaggedrevs_tracking', $insertions, __METHOD__, 'IGNORE' ); |
72 | | - } |
73 | 77 | } |
74 | 78 | |
75 | 79 | /* |
76 | 80 | * Get existing cache dependancies |
| 81 | + * @param int $flags FR_MASTER |
77 | 82 | * @return array (ns => dbKey => 1) |
78 | 83 | */ |
79 | | - protected function getExistingDeps() { |
80 | | - $dbr = wfGetDB( DB_SLAVE ); |
81 | | - $res = $dbr->select( 'flaggedrevs_tracking', |
| 84 | + protected function getExistingDeps( $flags = 0 ) { |
| 85 | + $db = ( $flags & FR_MASTER ) ? |
| 86 | + wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE ); |
| 87 | + $res = $db->select( 'flaggedrevs_tracking', |
82 | 88 | array( 'ftr_namespace', 'ftr_title' ), |
83 | 89 | array( 'ftr_from' => $this->title->getArticleId() ), |
84 | 90 | __METHOD__ |