This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new a9d5248 Preload to speed up a bit
a9d5248 is described below
commit a9d5248160ad0d2b732b2bd1a07a3b4afd94de7b
Author: Sebb <[email protected]>
AuthorDate: Sun May 23 17:31:41 2021 +0100
Preload to speed up a bit
Still quite slow; needs further work
---
www/secretary/ldap-check.cgi | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/www/secretary/ldap-check.cgi b/www/secretary/ldap-check.cgi
index 29d2d08..1827d7d 100755
--- a/www/secretary/ldap-check.cgi
+++ b/www/secretary/ldap-check.cgi
@@ -59,15 +59,16 @@ _html do
_th 'in project (owner or member) but not in committers group'
end
- projects = ASF::Project.list
+ projects = ASF::Project.preload # for performance
+ pmcs = ASF::Committee.pmcs
- projects.sort_by(&:name).each do |p|
+ projects.keys.sort_by(&:name).each do |p|
po=p.ownerids
pm=p.memberids
po_pm = po - pm
cttee = ASF::Committee.find(p.name)
# Is this a real PMC?
- if ASF::Committee.pmcs.include? cttee
+ if pmcs.include? cttee
isPMC = true
cm = cttee.roster.keys
cm_po = cm - po