Use HttpRequestFactory::createMultiClient()

Use the globally configured request timeout instead of MultiHttpClient's
hard-coded default. This means that the request timeout for
ForeignWikiRequest will typically be reduced from 900s to 25s.

Bug: T245170
Depends-On: I8252f6c854b98059f4916d5460ea71cf4b580149
Change-Id: I1c3d96720709253ad15bb8528cdd132571de2e4e
This commit is contained in:
Tim Starling 2020-05-21 14:22:38 +10:00
parent 7420a54684
commit 5252624729

View file

@ -1,6 +1,7 @@
<?php
use MediaWiki\Logger\LoggerFactory;
use MediaWiki\MediaWikiServices;
use MediaWiki\Session\SessionManager;
class EchoForeignWikiRequest {
@ -193,7 +194,7 @@ class EchoForeignWikiRequest {
* @throws Exception
*/
protected function doRequests( array $reqs ) {
$http = new MultiHttpClient( [] );
$http = MediaWikiServices::getInstance()->getHttpRequestFactory()->createMultiClient();
$responses = $http->runMulti( $reqs );
$results = [];