summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2012-08-28 01:20:14 -0700
committerIvan Kohler <ivan@freeside.biz>2012-08-28 01:20:14 -0700
commit63392290c6036b94622e770ba88f2275d6e4e5cf (patch)
treed0e89afec683802a8e7dffb5072949ed8ded83be
parent1b6a5f4347ffe0213e3642f5fb741b8b32cfa456 (diff)
prevent the "prepared statement "dbdpg_pN_N" already exists" errors that result in "Cant call method "HasRight" on an undefined value" errors, RT#19104
-rw-r--r--htetc/handler.pl9
1 files changed, 9 insertions, 0 deletions
diff --git a/htetc/handler.pl b/htetc/handler.pl
index d7c56572c..3c68e83ed 100644
--- a/htetc/handler.pl
+++ b/htetc/handler.pl
@@ -8,10 +8,19 @@ use FS::Mason qw( mason_interps );
use FS::Trace;
if ( %%%RT_ENABLED%%% ) {
+
require RT;
+
$> = scalar(getpwnam('freeside'));
+
RT::LoadConfig();
RT::Init();
+
+ # disconnect DB before fork:
+ # (avoid 'prepared statement "dbdpg_p\d+_\d+" already exists' errors?)
+ $RT::Handle->dbh(undef);
+ undef $RT::Handle;
+
$> = $<;
}