X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=htetc%2Fhandler.pl;h=d7c56572c35c9763a0139d12688b1a085cb2e5df;hb=43a3bfc79a80263967e5cba41ddbc72cec9c1e97;hp=77b93463fedbe25bbf365dea3922f32dc6d0ff25;hpb=07d63243b070962b8fcf8e6b59128ccf1305f8f8;p=freeside.git diff --git a/htetc/handler.pl b/htetc/handler.pl index 77b93463f..d7c56572c 100644 --- a/htetc/handler.pl +++ b/htetc/handler.pl @@ -7,6 +7,14 @@ use warnings; use FS::Mason qw( mason_interps ); use FS::Trace; +if ( %%%RT_ENABLED%%% ) { + require RT; + $> = scalar(getpwnam('freeside')); + RT::LoadConfig(); + RT::Init(); + $> = $<; +} + #use vars qw($r); # Bring in ApacheHandler, necessary for mod_perl integration. @@ -141,7 +149,9 @@ sub handler FS::Trace->log('done'); - FS::Trace->dumpfile("%%%FREESIDE_EXPORT%%%/profile/$$.".time, $r->filename) + FS::Trace->dumpfile( "%%%FREESIDE_EXPORT%%%/profile/$$.".time, + FS::Trace->total. ' '. $r->filename + ) if FS::Trace->total > 5; #10? FS::Trace->reset; @@ -149,19 +159,10 @@ sub handler $status; } -my $rt_initialized = 0; - sub my_rt_init { return unless $RT::VERSION; - - if ( $rt_initialized ) { - RT::ConnectToDatabase(); - RT::InitSignalHandlers(); - } else { - RT::LoadConfig(); - RT::Init(); - $rt_initialized++; - } + RT::ConnectToDatabase(); + RT::InitSignalHandlers(); } 1;