Index: trunk/extensions/CodeReview/CodeReview.php |
— | — | @@ -78,3 +78,5 @@ |
79 | 79 | // to an offsite proxy running this fun little proxy tool: |
80 | 80 | // http://svn.wikimedia.org/viewvc/mediawiki/trunk/tools/codereview-proxy/ |
81 | 81 | $wgSubversionProxy = false; |
| 82 | +$wgSubversionProxyTimeout = 30; // default 3 secs is too short :) |
| 83 | + |
Index: trunk/extensions/CodeReview/Subversion.php |
— | — | @@ -5,9 +5,9 @@ |
6 | 6 | protected $mRepo; |
7 | 7 | |
8 | 8 | public static function newFromRepo( $repo ) { |
9 | | - global $wgSubversionProxy; |
| 9 | + global $wgSubversionProxy, $wgSubversionProxyTimeout; |
10 | 10 | if( $wgSubversionProxy ) { |
11 | | - return new SubversionProxy( $repo, $wgSubversionProxy ); |
| 11 | + return new SubversionProxy( $repo, $wgSubversionProxy, $wgSubversionProxyTimeout ); |
12 | 12 | } elseif( function_exists( 'svn_log' ) ) { |
13 | 13 | return new SubversionPecl( $repo ); |
14 | 14 | } else { |
— | — | @@ -206,9 +206,10 @@ |
207 | 207 | * Using a remote JSON proxy |
208 | 208 | */ |
209 | 209 | class SubversionProxy extends SubversionAdaptor { |
210 | | - function __construct( $repo, $proxy ) { |
| 210 | + function __construct( $repo, $proxy, $timeout=30 ) { |
211 | 211 | parent::__construct( $repo ); |
212 | 212 | $this->mProxy = $proxy; |
| 213 | + $this->mTimeout = $timeout; |
213 | 214 | } |
214 | 215 | |
215 | 216 | function getFile( $path, $rev=null ) { |
— | — | @@ -239,7 +240,7 @@ |
240 | 241 | } |
241 | 242 | } |
242 | 243 | $target = $this->mProxy . '?' . wfArrayToCgi( $params ); |
243 | | - $json = Http::get( $target ); |
| 244 | + $json = Http::get( $target, $this->mTimeout ); |
244 | 245 | if( $json === false ) { |
245 | 246 | throw new MWException( "SVN proxy error" ); |
246 | 247 | } |