Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Bug 761469 - memcached code cleanups; r=telliott

  • Loading branch information...
commit 202314e6ab6ca36349931a42643d2ff36b6be3ef 1 parent c9db696
@rfk rfk authored
4 syncstorage/storage/
@@ -7,6 +7,8 @@
- User tabs are stored in one single "user_id:tabs" key
- The total storage size is stored in "user_id:size"
- The meta/global bso is stored in "user_id"
+- The last-modified time for the entire storage is stored in user_id:stamp
+- The info/collections timestamp mapping is stored in user_id:stamps
import threading
import thread
@@ -20,7 +22,7 @@
from mozsvc.exceptions import BackendError
-USER_KEYS = ('size', 'meta:global', 'tabs', 'stamps')
+USER_KEYS = ('size', 'size:ts', 'meta:global', 'tabs', 'stamps', 'stamp')
def _key(*args):
12 syncstorage/storage/
@@ -18,7 +18,7 @@
from syncstorage.util import get_timestamp
from import SQLStorage
from import bso
-from import CacheManager
+from import CacheManager, _key
# Recalculate quota if they have less than 1MB remaining.
@@ -33,10 +33,6 @@
bso.c.userid == bindparam('user_id')).group_by(bso.c.collection)
-def _key(*args):
- return ':'.join([str(arg) for arg in args])
# XXX suboptimal: creates an object on every dump/load call
# but that's how python-memcached works - using a class
# instead of an object would not be thread-safe.
@@ -147,12 +143,6 @@ def _get_item():
return _get_item()
- def _delete_cache(self, user_id):
- """Removes all cached data."""
- KEYS = ('size', 'size:ts', 'meta:global', 'tabs', 'stamps', 'stamp')
- for key in KEYS:
- self.cache.delete(_key(user_id, key))
def _update_stamp(self, user_id, collection_name, storage_time):
# update the stamps cache
stamps = self.get_collection_timestamps(user_id)

0 comments on commit 202314e

Please sign in to comment.
Something went wrong with that request. Please try again.