[CalendarServer-changes] [8997] CalendarServer/branches/users/gaya/ldapdirectorybacker/twistedcaldav /method/report_addressbook_query.py
source_changes at macosforge.org
source_changes at macosforge.org
Mon Apr 9 11:23:11 PDT 2012
Revision: 8997
http://trac.macosforge.org/projects/calendarserver/changeset/8997
Author: gaya at apple.com
Date: 2012-04-09 11:23:11 -0700 (Mon, 09 Apr 2012)
Log Message:
-----------
remove last change
Modified Paths:
--------------
CalendarServer/branches/users/gaya/ldapdirectorybacker/twistedcaldav/method/report_addressbook_query.py
Modified: CalendarServer/branches/users/gaya/ldapdirectorybacker/twistedcaldav/method/report_addressbook_query.py
===================================================================
--- CalendarServer/branches/users/gaya/ldapdirectorybacker/twistedcaldav/method/report_addressbook_query.py 2012-04-06 23:59:28 UTC (rev 8996)
+++ CalendarServer/branches/users/gaya/ldapdirectorybacker/twistedcaldav/method/report_addressbook_query.py 2012-04-09 18:23:11 UTC (rev 8997)
@@ -159,35 +159,25 @@
def queryDirectoryBackedAddressBook(directoryBackedAddressBook, addressBookFilter):
"""
"""
-
- # doAddressBookQuery() results may not match the filter but be limited.
- # if that happens, try again with a larger maxResults
- maxResults = max_number_of_results[0]
- while True:
- results, limited[0] = (yield directoryBackedAddressBook.directory.doAddressBookQuery( addressBookFilter, query, maxResults ))
- for vCardResult in results:
-
- # match against original filter
- if filter.match((yield vCardResult.vCard())):
-
- # Check size of results is within limit
- checkMaxResults()
-
- try:
- yield report_common.responseForHref(request, responses, vCardResult.hRef(), vCardResult, propertiesForResource, query, vcard=(yield vCardResult.vCard()))
- except ConcurrentModification:
- # This can happen because of a race-condition between the
- # time we determine which resources exist and the deletion
- # of one of these resources in another request. In this
- # case, we ignore the now missing resource rather
- # than raise an error for the entire report.
- log.err("Missing resource during sync: %s" % (vCardResult.hRef(),))
+ results, limited[0] = (yield directoryBackedAddressBook.directory.doAddressBookQuery( addressBookFilter, query, max_number_of_results[0] ))
+ for vCardResult in results:
- # query again if no matches and limited
- if matchcount[0] or not limited[0] or maxResults > config.MaxQueryWithDataResults:
- break
- maxResults *= 2
+ # match against original filter
+ if filter.match((yield vCardResult.vCard())):
+ # Check size of results is within limit
+ checkMaxResults()
+
+ try:
+ yield report_common.responseForHref(request, responses, vCardResult.hRef(), vCardResult, propertiesForResource, query, vcard=(yield vCardResult.vCard()))
+ except ConcurrentModification:
+ # This can happen because of a race-condition between the
+ # time we determine which resources exist and the deletion
+ # of one of these resources in another request. In this
+ # case, we ignore the now missing resource rather
+ # than raise an error for the entire report.
+ log.err("Missing resource during sync: %s" % (vCardResult.hRef(),))
+
if not addrresource.isAddressBookCollection():
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120409/082bdb16/attachment.html>
More information about the calendarserver-changes
mailing list