[CalendarServer-changes] [3386] CalendarServer/trunk/twistedcaldav/directory/appleopendirectory.py

source_changes at macosforge.org source_changes at macosforge.org
Mon Nov 17 13:31:48 PST 2008


Revision: 3386
          http://trac.macosforge.org/projects/calendarserver/changeset/3386
Author:   wsanchez at apple.com
Date:     2008-11-17 13:31:48 -0800 (Mon, 17 Nov 2008)
Log Message:
-----------
Fix recordWithGUID() logic

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/directory/appleopendirectory.py

Modified: CalendarServer/trunk/twistedcaldav/directory/appleopendirectory.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/directory/appleopendirectory.py	2008-11-17 21:28:00 UTC (rev 3385)
+++ CalendarServer/trunk/twistedcaldav/directory/appleopendirectory.py	2008-11-17 21:31:48 UTC (rev 3386)
@@ -296,12 +296,12 @@
         record = lookup()
 
         if record is None:
-            # Check negative cache
-            if guid in self._storage(recordType)["disabled guids"]:
-                return None
-
             # Cache miss; try looking the record up, in case it is new
             for recordType in self.recordTypes():
+                # Check negative cache
+                if guid in self._storage(recordType)["disabled guids"]:
+                    break
+
                 self.reloadCache(recordType, guid=guid)
                 record = lookup()
                 if record is not None:
@@ -309,13 +309,12 @@
                                   % (guid, recordType))
                     break
             else:
-                # Add to negative cache
+                # Nothing found; add to negative cache
                 self._storage(recordType)["disabled guids"].add(guid)
                 self.log_info("Unable to find any record with GUID %s" % (guid,))
 
         return record
 
-
     def groupsForGUID(self, guid):
         
         # Lookup in index
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20081117/acd450a5/attachment.html>


More information about the calendarserver-changes mailing list