[CalendarServer-changes] [5613] CalendarServer/branches/new-store/twistedcaldav

source_changes at macosforge.org source_changes at macosforge.org
Tue May 18 13:38:52 PDT 2010


Revision: 5613
          http://trac.macosforge.org/projects/calendarserver/changeset/5613
Author:   glyph at apple.com
Date:     2010-05-18 13:38:50 -0700 (Tue, 18 May 2010)
Log Message:
-----------
Remove unnecessary caching logic; caching should all be handled in the back-end

Modified Paths:
--------------
    CalendarServer/branches/new-store/twistedcaldav/method/put_addressbook_common.py
    CalendarServer/branches/new-store/twistedcaldav/static.py
    CalendarServer/branches/new-store/twistedcaldav/storebridge.py

Modified: CalendarServer/branches/new-store/twistedcaldav/method/put_addressbook_common.py
===================================================================
--- CalendarServer/branches/new-store/twistedcaldav/method/put_addressbook_common.py	2010-05-18 20:32:32 UTC (rev 5612)
+++ CalendarServer/branches/new-store/twistedcaldav/method/put_addressbook_common.py	2010-05-18 20:38:50 UTC (rev 5613)
@@ -48,7 +48,6 @@
 from twistedcaldav.vcard import Component
 from twistedcaldav.vcardindex import ReservationError
 from twext.python.log import Logger
-#from twistedcaldav.scheduling.implicit import ImplicitScheduler
 
 log = Logger()
 

Modified: CalendarServer/branches/new-store/twistedcaldav/static.py
===================================================================
--- CalendarServer/branches/new-store/twistedcaldav/static.py	2010-05-18 20:32:32 UTC (rev 5612)
+++ CalendarServer/branches/new-store/twistedcaldav/static.py	2010-05-18 20:38:50 UTC (rev 5613)
@@ -77,7 +77,7 @@
 from twistedcaldav.extensions import DAVFile, CachingPropertyStore
 from twistedcaldav.linkresource import LinkResource, LinkFollowerMixIn
 from twistedcaldav.memcachelock import MemcacheLock, MemcacheLockTimeoutError
-from twistedcaldav.memcacheprops import MemcachePropertyCollection
+
 from twistedcaldav.freebusyurl import FreeBusyURLResource
 from twistedcaldav.ical import Component as iComponent
 from twistedcaldav.ical import Property as iProperty
@@ -625,11 +625,6 @@
             if not child.startswith(".")
         ]
 
-    def propertyCollection(self):
-        if not hasattr(self, "_propertyCollection"):
-            self._propertyCollection = MemcachePropertyCollection(self)
-        return self._propertyCollection
-
     def createSimilarFile(self, path):
         if self.comparePath(path):
             return self

Modified: CalendarServer/branches/new-store/twistedcaldav/storebridge.py
===================================================================
--- CalendarServer/branches/new-store/twistedcaldav/storebridge.py	2010-05-18 20:32:32 UTC (rev 5612)
+++ CalendarServer/branches/new-store/twistedcaldav/storebridge.py	2010-05-18 20:38:50 UTC (rev 5613)
@@ -1,4 +1,4 @@
-# -*- test-case-name: twistedcaldav.test -*-
+# -*- test-case-name: twistedcaldav -*-
 ##
 # Copyright (c) 2005-2010 Apple Inc. All rights reserved.
 #
@@ -20,7 +20,7 @@
 in L{twistedcaldav}.
 """
 
-from twisted.internet.defer import inlineCallbacks, returnValue, succeed
+from twisted.internet.defer import succeed
 
 from twext.python.filepath import CachingFilePath as FilePath
 
@@ -151,56 +151,15 @@
         )
 
         if newStoreObject is not None:
-            # FIXME: what about creation in http_PUT?
             similar = CalendarObjectFile(newStoreObject, path)
         else:
+            # FIXME: creation in http_PUT should talk to a specific resource
+            # type; this is the domain of StoreCalendarObjectResource.
             # similar = ProtoCalendarObjectFile(self._newStoreCalendar, path)
             similar = CalDAVFile(path)
 
-        # FIXME: tests should fail without this:
+        # FIXME: tests should be failing without this line.
         # self.propagateTransaction(similar)
-
-        # Short-circuit stat with information we know to be true at this point
-        if isinstance(path, FilePath) and hasattr(self, "knownChildren"):
-            if path.basename() in self.knownChildren:
-                path.existsCached = True
-                path.isDirCached = False
-
-        #
-        # Override the dead property store
-        #
-        superDeadProperties = similar.deadProperties
-
-        def deadProperties():
-            if not hasattr(similar, "_dead_properties"):
-                similar._dead_properties = self.propertyCollection().propertyStoreForChild(
-                    similar,
-                    superDeadProperties(caching=False)
-                )
-            return similar._dead_properties
-
-        similar.deadProperties = deadProperties
-
-        #
-        # Override DELETE, MOVE
-        #
-        for method in ("DELETE", "MOVE"):
-            method = "http_" + method
-            original = getattr(similar, method)
-
-            @inlineCallbacks
-            def override(request, original=original):
-
-                # Call original method (which is deferred)
-                response = (yield original(request))
-
-                # Wipe the cache
-                similar.deadProperties().flushCache()
-
-                returnValue(response)
-
-            setattr(similar, method, override)
-        self.propagateTransaction(similar)
         return similar
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100518/9b99b444/attachment.html>


More information about the calendarserver-changes mailing list