From 615c45fbc9464c7d7f63afcb20971539742932d3 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 26 Jun 2005 07:44:28 +0000 Subject: [PATCH] Bump up read/write timeouts on the connection to insane levels --- maintenance/upgrade1_5.php | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/maintenance/upgrade1_5.php b/maintenance/upgrade1_5.php index ac7b8524e3..0b51c4634e 100644 --- a/maintenance/upgrade1_5.php +++ b/maintenance/upgrade1_5.php @@ -30,9 +30,7 @@ class FiveUpgrade { $this->conversionTables = $this->prepareWindows1252(); $this->dbw =& $this->newConnection(); - $this->dbr =& $this->newConnection(); - $this->dbr->bufferResults( false ); - $this->slave =& wfGetDB( DB_SLAVE ); + $this->dbr =& $this->streamConnection(); $this->cleanupSwaps = array(); $this->emailAuth = false; # don't preauthenticate emails @@ -74,9 +72,7 @@ class FiveUpgrade { /** - * Open a second connection to the master server, with buffering off. - * This will let us stream large datasets in and write in chunks on the - * other end. + * Open a connection to the master server with the admin rights. * @return Database * @access private */ @@ -87,6 +83,22 @@ class FiveUpgrade { return $db; } + /** + * Open a second connection to the master server, with buffering off. + * This will let us stream large datasets in and write in chunks on the + * other end. + * @return Database + * @access private + */ + function &streamConnection() { + $timeout = 3600 * 24; + $db =& $this->newConnection(); + $db->bufferResults( false ); + $db->query( "SET net_read_timeout=$timeout" ); + $db->query( "SET net_write_timeout=$timeout" ); + return $db; + } + /** * Prepare a conversion array for converting Windows Code Page 1252 to * UTF-8. This should provide proper conversion of text that was miscoded -- 2.20.1