OSDN Git Service

DB auto reconnect
authorISHIKAWA Mutsumi <ishikawa@hanzubon.jp>
Thu, 25 Oct 2012 03:09:15 +0000 (12:09 +0900)
committerISHIKAWA Mutsumi <ishikawa@hanzubon.jp>
Thu, 25 Oct 2012 03:09:15 +0000 (12:09 +0900)
mubot4fb.pl

index e7f1840..82bfc56 100755 (executable)
@@ -101,7 +101,7 @@ sub new {
 
 sub init {
        my ($me) = @_;
-       return $me->{dbh} = DBI->connect('DBI:mysql:'.$me->{cfg}->{database}, $me->{cfg}->{db_user}, $me->{cfg}->{db_pass},{mysql_enable_utf8 => 1}) || die $DBI::errstr;
+       return $me->{dbh} = DBI->connect('DBI:mysql:'.$me->{cfg}->{database}, $me->{cfg}->{db_user}, $me->{cfg}->{db_pass},{mysql_enable_utf8 => 1, mysql_auto_reconnect => 1}) || die $DBI::errstr;
 }
 
 sub check_dup {