speeding up the group/dump query in FAS
Ricky Zhou
ricky at fedoraproject.org
Tue Sep 7 15:42:02 UTC 2010
On 2010-09-06 04:52:23 PM, Matt_Domsch at Dell.com wrote:
> Currently this query takes several minutes. HAProxy (or something in the proxy series) times out the request, and returns a 500 to the client.
> https://admin.fedoraproject.org/accounts/group/dump/
>
> Any chance that could be optimized? FWIW, I use this query in my ftbfs script to convert package owner names to email addresses, so I can send the FTBFS report to the owner's emails directly (on bcc).
I know that Mike and Toshio are working on a fix to /group/dump, but I
just wanted to mention our JSON interface, which currently doesn't
suffer from the same problem. Would this code work for you?
--
from fedora.client.fas2 import AccountSystem
...
fas = AccountSystem(base_url=BASE_URL, username=USERNAME, password=PASSWORD)
constraints = { 'group': 'packager', 'role_status': 'approved' }
columns = ['username', 'email']
results = fas.people_query(constraints=constraints, columns=columns)
emails = dict((row['username'], row['email']) for row in results)
--
Thanks,
Ricky
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
Url : http://lists.fedoraproject.org/pipermail/infrastructure/attachments/20100907/79e5b446/attachment.bin
More information about the infrastructure
mailing list