Cache the hooks

git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@418 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
Matt Sergeant 2005-05-12 22:08:37 +00:00
parent e743c5903c
commit 37c96a1773

View File

@ -122,9 +122,15 @@ sub _config_from_file {
return wantarray ? @config : $config[0];
}
our $HOOKS;
sub load_plugins {
my $self = shift;
if ($HOOKS) {
return $self->{hooks} = $HOOKS;
}
$self->log(LOGERROR, "Plugins already loaded") if $self->{hooks};
$self->{hooks} = {};
@ -135,6 +141,8 @@ sub load_plugins {
@plugins = $self->_load_plugins($dir, @plugins);
$HOOKS = $self->{hooks};
return @plugins;
}