Disable conf_cache by default, enable it only when safe to do so
[freeside.git] / FS / FS / Conf.pm
index 855c9f4..e204747 100644 (file)
@@ -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 || ()),