]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 538705: Prevent database connections from timing out during long
authorMax Kanat-Alexander <mkanat@bugzilla.org>
Wed, 17 Mar 2010 08:38:32 +0000 (01:38 -0700)
committerMax Kanat-Alexander <mkanat@bugzilla.org>
Wed, 17 Mar 2010 08:38:32 +0000 (01:38 -0700)
jobqueue.pl runs.
r=LpSolit, a=mkanat

Bugzilla/DB/Mysql.pm

index 4f6f9d76fa35336b0013c49eb35a636512da9148..3a1c4ae6c0fdd4b782fab83136620e07cd2f4d7b 100644 (file)
@@ -68,9 +68,13 @@ sub new {
     $dsn .= ";port=$port" if $port;
     $dsn .= ";mysql_socket=$sock" if $sock;
 
-    my $attrs = { mysql_enable_utf8 => Bugzilla->params->{'utf8'} };
+    my %attrs = (
+        mysql_enable_utf8 => Bugzilla->params->{'utf8'},
+        # Needs to be explicitly specified for command-line processes.
+        mysql_auto_reconnect => 1,
+    );
     
-    my $self = $class->db_new($dsn, $user, $pass, $attrs);
+    my $self = $class->db_new($dsn, $user, $pass, \%attrs);
 
     # This makes sure that if the tables are encoded as UTF-8, we
     # return their data correctly.