From: Brion Vibber Date: Mon, 2 Oct 2006 17:30:44 +0000 (+0000) Subject: Include retry number on connect loop errors X-Git-Tag: 1.31.0-rc.0~55663 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/?a=commitdiff_plain;h=626eb19cbbc2ceff3fc8cca0cdd00d1ac947d619;p=lhc%2Fweb%2Fwiklou.git Include retry number on connect loop errors --- diff --git a/includes/Database.php b/includes/Database.php index 3378ccce9c..ca306631a5 100644 --- a/includes/Database.php +++ b/includes/Database.php @@ -494,7 +494,8 @@ class Database { # LIVE PATCH by Tim, ask Domas for why: retry loop $this->mConn = false; - for ( $i = 0; $i < 3 && !$this->mConn; $i++ ) { + $max = 3; + for ( $i = 0; $i < $max && !$this->mConn; $i++ ) { if ( $i > 1 ) { usleep( 1000 ); } @@ -505,7 +506,8 @@ class Database { @/**/$this->mConn = mysql_connect( $server, $user, $password, true ); } if ($this->mConn === false) { - wfLogDBError("Connect loop error ($server): " . mysql_errno() . " - " . mysql_error()."\n"); + $iplus = $i + 1; + wfLogDBError("Connect loop error $iplus of $max ($server): " . mysql_errno() . " - " . mysql_error()."\n"); } }