Manybubbles has uploaded a new change for review.
https://gerrit.wikimedia.org/r/96637
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(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Elastica
refs/changes/37/96637/1
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: newchange
Gerrit-Change-Id: Ic4a1013e2acca1ba9f7008c3bfaed4d96a8b9d5f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Elastica
Gerrit-Branch: master
Gerrit-Owner: Manybubbles <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits