[CalendarServer-changes] [4172] CalendarServer/trunk/twistedcaldav/directory

source_changes at macosforge.org source_changes at macosforge.org
Mon May 4 19:47:01 PDT 2009


Revision: 4172
          http://trac.macosforge.org/projects/calendarserver/changeset/4172
Author:   sagen at apple.com
Date:     2009-05-04 19:47:01 -0700 (Mon, 04 May 2009)
Log Message:
-----------
Forcing the imip user to be faulted into the cache early is causing migration to fail because it requires more of the system to be up and running too early.  Indexing on guid when a record is faulted in via other attributes is a more elegant solution to the local-user-faulting-by-guid problem anyway.

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/directory/cachingappleopendirectory.py
    CalendarServer/trunk/twistedcaldav/directory/cachingdirectory.py

Modified: CalendarServer/trunk/twistedcaldav/directory/cachingappleopendirectory.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/directory/cachingappleopendirectory.py	2009-05-05 01:14:37 UTC (rev 4171)
+++ CalendarServer/trunk/twistedcaldav/directory/cachingappleopendirectory.py	2009-05-05 02:47:01 UTC (rev 4172)
@@ -98,21 +98,6 @@
         self._records = {}
         self._delayedCalls = set()
 
-
-        # Special handling of the local user used for iMIP injection:
-        # Faulting by GUID doesn't work for local users, so we need to
-        # force the iMIP user into our GUID index and set the record
-        # to never expire.
-        if config.Scheduling.iMIP.Enabled:
-            imipUserName = config.Scheduling.iMIP.Username
-            if imipUserName:
-                imipRecord = self.recordWithShortName(self.recordType_users,
-                    imipUserName)
-                if imipRecord:
-                    self.recordCacheForType(self.recordType_users).addRecord(
-                        imipRecord, self.INDEX_TYPE_GUID, imipRecord.guid,
-                        neverExpire=True)
-
     def __cmp__(self, other):
         if not isinstance(other, DirectoryRecord):
             return super(DirectoryRecord, self).__eq__(other)

Modified: CalendarServer/trunk/twistedcaldav/directory/cachingdirectory.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/directory/cachingdirectory.py	2009-05-05 01:14:37 UTC (rev 4171)
+++ CalendarServer/trunk/twistedcaldav/directory/cachingdirectory.py	2009-05-05 02:47:01 UTC (rev 4172)
@@ -82,13 +82,20 @@
 
         self.records.add(record)
 
-        self.recordsIndexedBy[indexType][indexKey] = record
-        if useMemcache:
-            key = "dir|%s|%s" % (indexType, indexKey)
-            self.log_debug("Memcache: storing %s" % (key,))
-            self.directoryService.memcacheSet(key, record)
+        # Also index/cache on guid
+        indexTypes = [(indexType, indexKey)]
+        if indexType != CachingDirectoryService.INDEX_TYPE_GUID:
+            indexTypes.append((CachingDirectoryService.INDEX_TYPE_GUID,
+                record.guid))
 
+        for indexType, indexKey in indexTypes:
+            self.recordsIndexedBy[indexType][indexKey] = record
+            if useMemcache:
+                key = "dir|%s|%s" % (indexType, indexKey)
+                self.log_debug("Memcache: storing %s" % (key,))
+                self.directoryService.memcacheSet(key, record)
 
+
     def removeRecord(self, record):
         
         if record in self.records:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20090504/37367f0d/attachment-0001.html>


More information about the calendarserver-changes mailing list