[CalendarServer-changes] [3974] CalendarServer/trunk/twistedcaldav/directory/cachingdirectory.py
source_changes at macosforge.org
source_changes at macosforge.org
Fri Apr 10 18:01:06 PDT 2009
Revision: 3974
http://trac.macosforge.org/projects/calendarserver/changeset/3974
Author: wsanchez at apple.com
Date: 2009-04-10 18:01:06 -0700 (Fri, 10 Apr 2009)
Log Message:
-----------
Cosmetic
Modified Paths:
--------------
CalendarServer/trunk/twistedcaldav/directory/cachingdirectory.py
Modified: CalendarServer/trunk/twistedcaldav/directory/cachingdirectory.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/directory/cachingdirectory.py 2009-04-11 00:59:37 UTC (rev 3973)
+++ CalendarServer/trunk/twistedcaldav/directory/cachingdirectory.py 2009-04-11 01:01:06 UTC (rev 3974)
@@ -14,14 +14,6 @@
# limitations under the License.
##
-import time
-import types
-import memcache
-import base64
-
-from twistedcaldav.directory.directory import DirectoryService, DirectoryRecord, DirectoryError
-from twistedcaldav.config import config
-
"""
Caching directory service implementation.
"""
@@ -32,6 +24,16 @@
"DictRecordTypeCache",
]
+
+import time
+import types
+import memcache
+import base64
+
+from twistedcaldav.directory.directory import DirectoryService, DirectoryRecord, DirectoryError
+from twistedcaldav.config import config
+
+
class RecordTypeCache(object):
"""
Abstract class for a record type cache. We will likely have dict and memcache implementations of this.
@@ -162,10 +164,12 @@
record.service = None # so we don't pickle service
key = base64.b64encode(key)
- if not self._getMemcacheClient().set(key, record, self.cacheTimeout):
+ if not self._getMemcacheClient().set(key, record, time=self.cacheTimeout):
self.log_error("Could not write to memcache, retrying")
- if not self._getMemcacheClient(refresh=True).set(key, record,
- self.cacheTimeout):
+ if not self._getMemcacheClient(refresh=True).set(
+ key, record,
+ time=self.cacheTimeout
+ ):
self.log_error("Could not write to memcache again, giving up")
del self.memcacheClient
raise DirectoryMemcacheError("Failed to write to memcache")
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20090410/9b6c8703/attachment-0001.html>
More information about the calendarserver-changes
mailing list