summaryrefslogtreecommitdiff
path: root/htetc
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2012-08-28 01:20:13 -0700
committerIvan Kohler <ivan@freeside.biz>2012-08-28 01:20:13 -0700
commit4e43da6dff682295e4e0b2fbdd7097fce95c68d7 (patch)
tree91eb647d6ffa5675bbad9b0634755e6358998a4f /htetc
parent1c7805046b0d15dd57db594211b924bc10e48ab7 (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
Diffstat (limited to 'htetc')
-rw-r--r--htetc/handler.pl9
1 files changed, 9 insertions, 0 deletions
diff --git a/htetc/handler.pl b/htetc/handler.pl
index d7c5657..3c68e83 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;
+
$> = $<;
}