Siebrand has uploaded a new change for review.
https://gerrit.wikimedia.org/r/96306
Change subject: Update formatting
......................................................................
Update formatting
Change-Id: I5cd038afb609eb71e86b7e23839083cea2531e1a
---
M includes/clientpool/RedisConnectionPool.php
1 file changed, 9 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/06/96306/1
diff --git a/includes/clientpool/RedisConnectionPool.php
b/includes/clientpool/RedisConnectionPool.php
index eb30a1d..987ad3f 100644
--- a/includes/clientpool/RedisConnectionPool.php
+++ b/includes/clientpool/RedisConnectionPool.php
@@ -102,6 +102,7 @@
if ( !isset( $options['password'] ) ) {
$options['password'] = null;
}
+
return $options;
}
@@ -127,6 +128,7 @@
self::$instances[$id] = new self( $options );
wfDebug( "Creating a new " . __CLASS__ . " instance
with id $id." );
}
+
return self::$instances[$id];
}
@@ -151,6 +153,7 @@
// Server is dead
wfDebug( "server $server is marked down for
another " .
( $this->downServers[$server] - $now )
. " seconds, can't get connection" );
+
return false;
}
}
@@ -161,6 +164,7 @@
if ( $connection['free'] ) {
$connection['free'] = false;
--$this->idlePoolSize;
+
return new RedisConnRef( $this,
$server, $connection['conn'] );
}
}
@@ -195,6 +199,7 @@
wfDebugLog( 'redis', "Could not connect to
server $server" );
// Mark server down for some time to avoid
further timeouts
$this->downServers[$server] = time() +
self::SERVER_DOWN_TTL;
+
return false;
}
if ( $this->password !== null ) {
@@ -205,12 +210,14 @@
} catch ( RedisException $e ) {
$this->downServers[$server] = time() +
self::SERVER_DOWN_TTL;
wfDebugLog( 'redis', "Redis exception: " .
$e->getMessage() . "\n" );
+
return false;
}
if ( $conn ) {
$conn->setOption( Redis::OPT_SERIALIZER,
$this->serializer );
$this->connections[$server][] = array( 'conn' => $conn,
'free' => false );
+
return new RedisConnRef( $this, $server, $conn );
} else {
return false;
@@ -304,9 +311,11 @@
if ( $this->password !== null ) {
if ( !$conn->auth( $this->password ) ) {
wfDebugLog( 'redis', "Authentication error
connecting to $server" );
+
return false;
}
}
+
return true;
}
}
--
To view, visit https://gerrit.wikimedia.org/r/96306
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5cd038afb609eb71e86b7e23839083cea2531e1a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Siebrand <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits