From: Jason Terry Date: Tue, 17 Feb 2015 16:50:56 +0000 (-0700) Subject: Disable conf_cache by default, enable it only when safe to do so X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=688288d7c60a648519d3b0127cd9286401078204 Disable conf_cache by default, enable it only when safe to do so Conflicts: FS/FS/Conf.pm --- diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index 855c9f421..e20474743 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -1,7 +1,9 @@ package FS::Conf; use strict; -use vars qw($base_dir @config_items @base_items @card_types $DEBUG $conf_cache); +use vars qw( $base_dir @config_items @base_items @card_types $DEBUG + $conf_cache $conf_cache_enabled + ); use Carp; use IO::File; use File::Basename; @@ -121,6 +123,7 @@ sub _config { my($self,$name,$agentnum,$agentonly)=@_; my $hashref = { 'name' => $name }; local $FS::Record::conf = undef; # XXX evil hack prevents recursion + $conf_cache = undef unless $conf_cache_enabled; # use cache only when it is safe to do so my $cv; my @a = ( ($agentnum || ()), diff --git a/htetc/handler.pl b/htetc/handler.pl index 3c68e83ed..18108ab11 100644 --- a/htetc/handler.pl +++ b/htetc/handler.pl @@ -6,6 +6,9 @@ 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 if ( %%%RT_ENABLED%%% ) {