From: Brion Vibber Date: Sun, 26 Jun 2005 07:44:28 +0000 (+0000) Subject: Bump up read/write timeouts on the connection to insane levels X-Git-Tag: 1.5.0beta1~4 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=commitdiff_plain;h=615c45fbc9464c7d7f63afcb20971539742932d3;p=lhc%2Fweb%2Fwiklou.git Bump up read/write timeouts on the connection to insane levels --- 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