From 626eb19cbbc2ceff3fc8cca0cdd00d1ac947d619 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 2 Oct 2006 17:30:44 +0000 Subject: [PATCH] Include retry number on connect loop errors --- includes/Database.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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"); } } -- 2.20.1