Index: trunk/extensions/CodeReview/ApiCodeUpdate.php |
— | — | @@ -46,6 +46,14 @@ |
47 | 47 | 'message' => $codeRev->getMessage() |
48 | 48 | ); |
49 | 49 | } |
| 50 | + // Cache the diffs if there are a only a few. |
| 51 | + // Mainly for WMF post-commit ping hook... |
| 52 | + if( count($result) <= 2 ) { |
| 53 | + foreach( $result as $revData ) { |
| 54 | + $rev = $repo->getRevision( $revData['id'] ); |
| 55 | + $diff = $repo->getDiff( $revData['id'] ); // trigger caching |
| 56 | + } |
| 57 | + } |
50 | 58 | $this->getResult()->setIndexedTagName($result, 'rev'); |
51 | 59 | $this->getResult()->addValue(null, $this->getModuleName(), $result); |
52 | 60 | } |