Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(550)

Unified Diff: chrome/common/extensions/docs/server2/memcache_object_store.py

Issue 660383002: Docserver: Persist stat cache for versioned file systems (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: change caching strategy, better refresh cycle synchronization Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/server2/memcache_object_store.py
diff --git a/chrome/common/extensions/docs/server2/memcache_object_store.py b/chrome/common/extensions/docs/server2/memcache_object_store.py
index 78d924166b3ff3da33d6632d81886b23d109e3a9..0099896f0da080d1156c49dcaeacb9ab56a04dbf 100644
--- a/chrome/common/extensions/docs/server2/memcache_object_store.py
+++ b/chrome/common/extensions/docs/server2/memcache_object_store.py
@@ -5,6 +5,7 @@
import logging
from appengine_wrappers import memcache
+from future import Future
from object_store import ObjectStore
class _AsyncMemcacheGetFuture(object):
@@ -22,9 +23,11 @@ class MemcacheObjectStore(ObjectStore):
# talking_alarm_clock always fails because the zip is too big.
# TODO(kalman): store example zips in blobstore.
if any(key.find('talking_alarm_clock') != -1 for key in mapping.iterkeys()):
- return
+ return Future(callback=lambda: None)
try:
- memcache.Client().set_multi_async(mapping, namespace=self._namespace)
+ rpc = memcache.Client().set_multi_async(mapping,
+ namespace=self._namespace)
+ return _AsyncMemcacheGetFuture(rpc)
except ValueError as e:
logging.error('Caught "ValueError: %s" when mapping keys %s' % (
e, mapping.keys()))

Powered by Google App Engine
This is Rietveld 408576698