From: Derick Alangi Date: Fri, 11 Jan 2019 09:43:39 +0000 (+0100) Subject: clientpool: Fix non-canonical order of elements (PHPDocs) X-Git-Tag: 1.34.0-rc.0~3095^2 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=87d890fbff21471302d97f481196eecade423283;p=lhc%2Fweb%2Fwiklou.git clientpool: Fix non-canonical order of elements (PHPDocs) Change-Id: Ia45326a11ae6da2b3196804d70f823c841570e7c --- diff --git a/includes/clientpool/SquidPurgeClientPool.php b/includes/clientpool/SquidPurgeClientPool.php index f6109f1d88..5acac63c3a 100644 --- a/includes/clientpool/SquidPurgeClientPool.php +++ b/includes/clientpool/SquidPurgeClientPool.php @@ -20,7 +20,7 @@ * @file */ class SquidPurgeClientPool { - /** @var array Array of SquidPurgeClient */ + /** @var SquidPurgeClient[] */ protected $clients = []; /** @var int */ @@ -46,11 +46,9 @@ class SquidPurgeClientPool { public function run() { $done = false; $startTime = microtime( true ); + while ( !$done ) { $readSockets = $writeSockets = []; - /** - * @var $client SquidPurgeClient - */ foreach ( $this->clients as $clientIndex => $client ) { $sockets = $client->getReadSocketsForSelect(); foreach ( $sockets as $i => $socket ) { @@ -64,6 +62,7 @@ class SquidPurgeClientPool { if ( !count( $readSockets ) && !count( $writeSockets ) ) { break; } + $exceptSockets = null; $timeout = min( $startTime + $this->timeout - microtime( true ), 1 ); Wikimedia\suppressWarnings(); @@ -74,6 +73,7 @@ class SquidPurgeClientPool { socket_strerror( socket_last_error() ) . "\n" ); break; } + // Check for timeout, use 1% tolerance since we aimed at having socket_select() // exit at precisely the overall timeout if ( microtime( true ) - $startTime > $this->timeout * 0.99 ) { @@ -101,6 +101,7 @@ class SquidPurgeClientPool { } } } + foreach ( $this->clients as $client ) { $client->close(); }