From 3cbaf4bbe1fe5f3b9f520e057ad8ef7c4d92d9c3 Mon Sep 17 00:00:00 2001 From: short <> Date: Thu, 14 Oct 2004 23:38:01 +0000 Subject: [PATCH] Turn off caching on the server side. - Prevent: MySQL server has gone away --- perlmail-submit | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/perlmail-submit b/perlmail-submit index d01bc39..4711b74 100755 --- a/perlmail-submit +++ b/perlmail-submit @@ -38,6 +38,9 @@ use POSIX qw(mktime); use Fcntl qw(:flock); +my $DBI_CACHE=0; # Cache DBI requests - may cause: MySQL server has gone away + + open DBI_PWD,$DBI_pwd or die "open \"$DBI_pwd\": $!"; $DBI_pwd=; close DBI_PWD or warn "close DBI_pwd: $!"; @@ -46,7 +49,7 @@ chomp $DBI_pwd; my $DBI; sub DBI { - return $DBI if $DBI; + return $DBI if $DBI_CACHE && $DBI; $DBI=DBI->connect("DBI:mysql:database=$DBI_database;host=","$DBI_user",$DBI_pwd,{ "PrintError"=>0, # handled by "RaiseError" below "RaiseError"=>1, -- 1.8.3.1