Mhutti1 has uploaded a new change for review. https://gerrit.wikimedia.org/r/263142
Change subject: Fixed verification-error due to incorrect timeout handling ...................................................................... Fixed verification-error due to incorrect timeout handling Passed timeout variable from config directly into fetchFile method and removed the redundant timeout code from WikiChecks. Bug: T11905 Change-Id: Ib57f74cd69864d3419120d4e4e862934f18862e2 --- M includes/Handlers/UploadHandler.php M includes/Helpers/WikiChecks.php 2 files changed, 3 insertions(+), 24 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GWToolset refs/changes/42/263142/1 diff --git a/includes/Handlers/UploadHandler.php b/includes/Handlers/UploadHandler.php index 2191d4b..7df5d2a 100644 --- a/includes/Handlers/UploadHandler.php +++ b/includes/Handlers/UploadHandler.php @@ -864,7 +864,6 @@ ) { // Initialize the upload object $upload = new UploadFromUrl(); - WikiChecks::increaseHTTPTimeout(); $upload->initialize( $Title->getBaseText(), @@ -872,8 +871,10 @@ false ); + $httpOptions['timeout'] = Config::$http_timeout; + // Fetch the file - returns a Status Object - $status = $upload->fetchFile(); + $status = $upload->fetchFile( $httpOptions ); if ( !$status->isOk() ) { $upload->cleanupTempFile(); return $status; diff --git a/includes/Helpers/WikiChecks.php b/includes/Helpers/WikiChecks.php index e771c40..6860a9f 100644 --- a/includes/Helpers/WikiChecks.php +++ b/includes/Helpers/WikiChecks.php @@ -172,28 +172,6 @@ } /** - * UploadFromUrl & Api->upload timeout on large files that take a long time - * to upload without this setting - * - * wiki default is 25 seconds - * e.g., http://academia.lndb.lv/xmlui/bitstream/handle/1/231/k_001_ktl1-1-27.jpg - * @todo: what is this limit set to on production? - * @todo: does ui need a notice to user about this limitation? - */ - public static function increaseHTTPTimeout( $timeout = 0 ) { - global $wgHTTPTimeout; - - if ( empty( $timeout ) ) { - $timeout = Config::$http_timeout; - } - - if ( $wgHTTPTimeout < $timeout ) { - self::$wgHTTPTimeout = $wgHTTPTimeout; - $wgHTTPTimeout = $timeout; - } - } - - /** * @param {SpecialPage} $SpecialPage * @return {Status} */ -- To view, visit https://gerrit.wikimedia.org/r/263142 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib57f74cd69864d3419120d4e4e862934f18862e2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/GWToolset Gerrit-Branch: master Gerrit-Owner: Mhutti1 <mhut...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits