Bug 897029: Preload bug permissions when calling Bug.get to improve performance

r/a=sgreen


git-svn-id: svn://10.0.0.236/trunk@264931 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzrmirror%bugzilla.org 2013-08-13 18:14:02 +00:00
parent 405ee04790
commit 6738e57abc
2 changed files with 7 additions and 1 deletions

View File

@ -1 +1 @@
8673 8674

View File

@ -323,6 +323,12 @@ sub get {
my @bugs; my @bugs;
my @faults; my @faults;
# Cache permissions for bugs. This highly reduces the number of calls to the DB.
# visible_bugs() is only able to handle bug IDs, so we have to skip aliases.
my @int = grep { $_ =~ /^\d+$/ } @$ids;
Bugzilla->user->visible_bugs(\@int);
foreach my $bug_id (@$ids) { foreach my $bug_id (@$ids) {
my $bug; my $bug;
if ($params->{permissive}) { if ($params->{permissive}) {