X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=htetc%2Fhandler.pl;h=4bb214c9805611fb897dc36d1f2853b0203b7ee6;hp=d7c56572c35c9763a0139d12688b1a085cb2e5df;hb=457e0196ba9bb87ecbbc82931b2f14d3195559f2;hpb=43a3bfc79a80263967e5cba41ddbc72cec9c1e97 diff --git a/htetc/handler.pl b/htetc/handler.pl index d7c56572c..4bb214c98 100644 --- a/htetc/handler.pl +++ b/htetc/handler.pl @@ -6,12 +6,30 @@ use strict; use warnings; use FS::Mason qw( mason_interps ); use FS::Trace; +use FS::Conf; + +$FS::Conf::conf_cache_enabled = 1; # enable FS::Conf caching for performance + +# Preload to share in mod_perl parent for performance +use FS::UID qw(load_schema); +load_schema(); +use FS::Record qw(fk_methods_init); +fk_methods_init; 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; + $> = $<; } @@ -95,7 +113,6 @@ sub handler return -1 if defined( $r->content_type ) && $r->content_type !~ m!(^text/|\bxml\b)!io; - local $SIG{__WARN__}; local $SIG{__DIE__};