diff options
author | Ivan Kohler <ivan@freeside.biz> | 2012-06-12 04:03:14 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2012-06-12 04:03:14 -0700 |
commit | 22a1feb55c4bb705064a04646ff5c321b8112ce1 (patch) | |
tree | f2690f9f6af03724d5eaf2ef12b35674e6e4a92a /htetc | |
parent | dc058e6549b8353ae16e8a1b3f6d88b667d5c8d9 (diff) |
possibly fix intermittent "could not receive data from server: Bad file
Diffstat (limited to 'htetc')
-rw-r--r-- | htetc/handler.pl | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/htetc/handler.pl b/htetc/handler.pl index b00ab6d..cea3661 100644 --- a/htetc/handler.pl +++ b/htetc/handler.pl @@ -84,7 +84,7 @@ sub handler local $SIG{__WARN__}; local $SIG{__DIE__}; - RT::Init(); + my_rt_init(); $ah->interp($rt_interp); @@ -93,7 +93,7 @@ sub handler local $SIG{__WARN__}; local $SIG{__DIE__}; - RT::Init() if $RT::VERSION; #for lack of something else + my_rt_init(); #we don't want the RT error handlers under FS { @@ -128,4 +128,19 @@ 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++; + } +} + 1; |