Chad has submitted this change and it was merged.

Change subject: Let client code set the client side timeout
......................................................................


Let client code set the client side timeout

This is the CURL timeout.

Required for
Bug: 57215

Change-Id: Ic4a1013e2acca1ba9f7008c3bfaed4d96a8b9d5f
---
M ElasticaConnection.php
1 file changed, 13 insertions(+), 0 deletions(-)

Approvals:
  Chad: Verified; Looks good to me, approved



diff --git a/ElasticaConnection.php b/ElasticaConnection.php
index d395e1b..4221376 100644
--- a/ElasticaConnection.php
+++ b/ElasticaConnection.php
@@ -40,6 +40,19 @@
        }
 
        /**
+        * Set the client side timeout to be used for the rest of this process.
+        * @param int $timeout timeout in seconds
+        */
+       public static function setTimeout( $timeout ) {
+               $client = self::getClient();
+               // Set the timeout for new connections
+               $client->setConfigValue( 'timeout', $timeout );
+               foreach ( $client->getConnections() as $connection ) {
+                       $connection->setTimeout( $timeout );
+               }
+       }
+
+       /**
         * Fetch a connection.
         * @return \Elastica\Client
         */

-- 
To view, visit https://gerrit.wikimedia.org/r/96637
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic4a1013e2acca1ba9f7008c3bfaed4d96a8b9d5f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Elastica
Gerrit-Branch: master
Gerrit-Owner: Manybubbles <[email protected]>
Gerrit-Reviewer: Chad <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to