projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
a9f62de
)
fix multi-database installs, while hopefully keeping performance improvement
author
ivan
<ivan>
Fri, 28 Jun 2002 08:23:44 +0000
(08:23 +0000)
committer
ivan
<ivan>
Fri, 28 Jun 2002 08:23:44 +0000
(08:23 +0000)
FS/FS/Record.pm
patch
|
blob
|
history
FS/FS/UID.pm
patch
|
blob
|
history
diff --git
a/FS/FS/Record.pm
b/FS/FS/Record.pm
index
f7c3a41
..
7d5ff05
100644
(file)
--- a/
FS/FS/Record.pm
+++ b/
FS/FS/Record.pm
@@
-2,7
+2,7
@@
package FS::Record;
use strict;
use vars qw( $dbdef_file $dbdef $setup_hack $AUTOLOAD @ISA @EXPORT_OK $DEBUG
use strict;
use vars qw( $dbdef_file $dbdef $setup_hack $AUTOLOAD @ISA @EXPORT_OK $DEBUG
- $me );
+ $me
%dbdef_cache
);
use subs qw(reload_dbdef);
use Exporter;
use Carp qw(carp cluck croak confess);
use subs qw(reload_dbdef);
use Exporter;
use Carp qw(carp cluck croak confess);
@@
-1130,8
+1130,10
@@
I<$FS::Record::setup_hack> is true. Returns a DBIx::DBSchema object.
sub reload_dbdef {
my $file = shift || $dbdef_file;
sub reload_dbdef {
my $file = shift || $dbdef_file;
- $dbdef = load DBIx::DBSchema $file
- or die "can't load database schema from $file";
+ $dbdef = exists $dbdef_cache{$file}
+ ? $dbdef_cache{$file}
+ : $dbdef_cache{$file} = DBIx::DBSchema->load( $file )
+ or die "can't load database schema from $file";
}
=item dbdef
}
=item dbdef
diff --git
a/FS/FS/UID.pm
b/FS/FS/UID.pm
index
87830cb
..
b1e590f
100644
(file)
--- a/
FS/FS/UID.pm
+++ b/
FS/FS/UID.pm
@@
-92,7
+92,7
@@
sub forksuidsetup {
foreach ( keys %callback ) {
&{$callback{$_}};
foreach ( keys %callback ) {
&{$callback{$_}};
- delete $callback{$_}; #run once
+
# breaks multi-database installs #
delete $callback{$_}; #run once
}
$dbh;
}
$dbh;
@@
-256,7
+256,7
@@
coderef into the hash %FS::UID::callback :
=head1 VERSION
=head1 VERSION
-$Id: UID.pm,v 1.1
5 2002-06-14 09:19:33
ivan Exp $
+$Id: UID.pm,v 1.1
6 2002-06-28 08:23:44
ivan Exp $
=head1 BUGS
=head1 BUGS