[CalendarServer-changes] [5739] CalendarServer/branches/new-store/twistedcaldav/static.py

source_changes at macosforge.org source_changes at macosforge.org
Tue Jun 15 11:53:35 PDT 2010


Revision: 5739
          http://trac.macosforge.org/projects/calendarserver/changeset/5739
Author:   glyph at apple.com
Date:     2010-06-15 11:53:32 -0700 (Tue, 15 Jun 2010)
Log Message:
-----------
Disable rollup caching for the moment since it writes directly to the filesystem

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

Modified: CalendarServer/branches/new-store/twistedcaldav/static.py
===================================================================
--- CalendarServer/branches/new-store/twistedcaldav/static.py	2010-06-15 18:52:22 UTC (rev 5738)
+++ CalendarServer/branches/new-store/twistedcaldav/static.py	2010-06-15 18:53:32 UTC (rev 5739)
@@ -302,37 +302,39 @@
     def iCalendarRolledup(self, request):
         if self.isPseudoCalendarCollection():
 
+
+# FIXME: move cache implementation!
             # Determine the cache key
-            isvirt = (yield self.isVirtualShare(request))
-            if isvirt:
-                principal = (yield self.resourceOwnerPrincipal(request))
-                if principal:
-                    cacheKey = principal.principalUID()
-                else:
-                    cacheKey = "unknown"
-            else:
-                isowner = (yield self.isOwner(request, adminprincipals=True, readprincipals=True))
-                cacheKey = "owner" if isowner else "notowner"
+#            isvirt = (yield self.isVirtualShare(request))
+#            if isvirt:
+#                principal = (yield self.resourceOwnerPrincipal(request))
+#                if principal:
+#                    cacheKey = principal.principalUID()
+#                else:
+#                    cacheKey = "unknown"
+#            else:
+#                isowner = (yield self.isOwner(request, adminprincipals=True, readprincipals=True))
+#                cacheKey = "owner" if isowner else "notowner"
                 
             # Now check for a cached .ics
-            rolled = self.fp.child(".subscriptions")
-            if not rolled.exists():
-                try:
-                    rolled.makedirs()
-                except IOError, e:
-                    log.err("Unable to create internet calendar subscription cache directory: %s because of: %s" % (rolled.path, e,))
-                    raise HTTPError(ErrorResponse(responsecode.INTERNAL_SERVER_ERROR))
-            cached = rolled.child(cacheKey)
-            if cached.exists():
-                try:
-                    cachedData = cached.open().read()
-                except IOError, e:
-                    log.err("Unable to open or read internet calendar subscription cache file: %s because of: %s" % (cached.path, e,))
-                else:
-                    # Check the cache token
-                    token, data = cachedData.split("\r\n", 1)
-                    if token == self.getSyncToken():
-                        returnValue(data)
+#            rolled = self.fp.child(".subscriptions")
+#            if not rolled.exists():
+#                try:
+#                    rolled.makedirs()
+#                except IOError, e:
+#                    log.err("Unable to create internet calendar subscription cache directory: %s because of: %s" % (rolled.path, e,))
+#                    raise HTTPError(ErrorResponse(responsecode.INTERNAL_SERVER_ERROR))
+#            cached = rolled.child(cacheKey)
+#            if cached.exists():
+#                try:
+#                    cachedData = cached.open().read()
+#                except IOError, e:
+#                    log.err("Unable to open or read internet calendar subscription cache file: %s because of: %s" % (cached.path, e,))
+#                else:
+#                    # Check the cache token
+#                    token, data = cachedData.split("\r\n", 1)
+#                    if token == self.getSyncToken():
+#                        returnValue(data)
 
             # Generate a monolithic calendar
             calendar = iComponent("VCALENDAR")
@@ -382,10 +384,10 @@
             # Cache the data
             data = str(calendar)
             data = self.getSyncToken() + "\r\n" + data
-            try:
-                cached.open(mode='w').write(data)
-            except IOError, e:
-                log.err("Unable to open or write internet calendar subscription cache file: %s because of: %s" % (cached.path, e,))
+#            try:
+#                cached.open(mode='w').write(data)
+#            except IOError, e:
+#                log.err("Unable to open or write internet calendar subscription cache file: %s because of: %s" % (cached.path, e,))
                 
             returnValue(calendar)
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100615/163e766e/attachment.html>


More information about the calendarserver-changes mailing list