Unverified Commit 5c3b724e authored by seblgr's avatar seblgr Committed by GitHub
Browse files

Prevent unnecessary DB access in add_list_member

In add_list_member the value $current_list_members_count is discarded if max_list_member == 0 (default setting).
This prevents the "high db load" produced by the successive DB accesses.
parent 15002e25
......@@ -3822,7 +3822,10 @@ sub add_list_member {
$self->{'add_outcome'}{'remaining_members_to_add'} =
$self->{'add_outcome'}{'expected_number_of_added_users'};
my $current_list_members_count = $self->get_total; # FIXME: high db load
my $current_list_members_count = 0;
if ($self->{'admin'}{'max_list_members'} > 0) {
$current_list_members_count = $self->get_total; # FIXME: high db load
}
my $sdm = Sympa::DatabaseManager->instance;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment