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

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

Issue 10828235: Extensions Docs Server: Efficient MemcacheFileSystem (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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_file_system.py
diff --git a/chrome/common/extensions/docs/server2/memcache_file_system.py b/chrome/common/extensions/docs/server2/memcache_file_system.py
index 5ac407237cabd5055aeee07a1def863a80b4d147..ec3654582cb2aae6ca24e9a7f935e862013abd02 100644
--- a/chrome/common/extensions/docs/server2/memcache_file_system.py
+++ b/chrome/common/extensions/docs/server2/memcache_file_system.py
@@ -20,11 +20,15 @@ class MemcacheFileSystem(FileSystem):
version = self._memcache.Get(path, memcache.MEMCACHE_FILE_SYSTEM_STAT)
if version is None:
stat_info = self._file_system.Stat(path)
- self._memcache.Set(path,
+ self._memcache.Set(path.rsplit('/', 1)[0] + '/',
stat_info.version,
memcache.MEMCACHE_FILE_SYSTEM_STAT)
+ for child_path, child_version in stat_info.child_versions.iteritems():
+ self._memcache.Set(path.rsplit('/', 1)[0] + '/' + child_path,
+ child_version,
+ memcache.MEMCACHE_FILE_SYSTEM_STAT)
else:
- stat_info = self.StatInfo(version)
+ stat_info = self.StatInfo(version, {})
return stat_info
def Read(self, paths, binary=False):

Powered by Google App Engine
This is Rietveld 408576698