summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2013-07-30 11:15:15 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2013-07-30 11:15:15 +0200
commitc5fb55b45ed5ed9b51ab967ab4b1019085641294 (patch)
tree3c3a655fc6e3cb7939850927feb9631c6d83ca48 /Bugzilla
parent6fd9f0a35c71219124f972afecc2c41ad047f660 (diff)
downloadbugzilla-c5fb55b45ed5ed9b51ab967ab4b1019085641294.tar.gz
bugzilla-c5fb55b45ed5ed9b51ab967ab4b1019085641294.tar.xz
Bug 897029: Preload bug permissions when calling Bug.get to improve performance
r/a=sgreen
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/WebService/Bug.pm6
1 files changed, 6 insertions, 0 deletions
diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm
index 9c4906883..c639084ef 100644
--- a/Bugzilla/WebService/Bug.pm
+++ b/Bugzilla/WebService/Bug.pm
@@ -323,6 +323,12 @@ sub get {
my @bugs;
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) {
my $bug;
if ($params->{permissive}) {