Skip load balancing stuff if there is only one server
authorTim Starling <tstarling@users.mediawiki.org>
Sat, 14 Oct 2006 06:49:22 +0000 (06:49 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sat, 14 Oct 2006 06:49:22 +0000 (06:49 +0000)
includes/LoadBalancer.php

index 3e81aea..3690b43 100644 (file)
@@ -141,6 +141,9 @@ class LoadBalancer {
                $i = false;
                if ( $this->mForce >= 0 ) {
                        $i = $this->mForce;
+               } elseif ( count( $this->mServers ) == 1 )  {
+                       # Skip the load balancing if there's only one server
+                       $i = 0;
                } else {
                        if ( $this->mReadIndex >= 0 ) {
                                $i = $this->mReadIndex;