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

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

Issue 10834329: Extension docs server: many changes to bring down the latency of the server, (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/github_file_system.py
diff --git a/chrome/common/extensions/docs/server2/github_file_system.py b/chrome/common/extensions/docs/server2/github_file_system.py
index ccb51c44185f7f9b428f70eeadb145e063fc0d69..0422c6ef6ca9b44864b9c37882034c8d032fc275 100644
--- a/chrome/common/extensions/docs/server2/github_file_system.py
+++ b/chrome/common/extensions/docs/server2/github_file_system.py
@@ -7,7 +7,7 @@ import os
import appengine_blobstore as blobstore
import appengine_memcache as memcache
-import file_system
+from file_system import FileSystem, StatInfo
from io import BytesIO
from future import Future
from zipfile import ZipFile
@@ -33,7 +33,7 @@ class _AsyncFetchFutureZip(object):
blobstore.BLOBSTORE_GITHUB)
return ZipFile(BytesIO(blob))
-class GithubFileSystem(file_system.FileSystem):
+class GithubFileSystem(FileSystem):
"""FileSystem implementation which fetches resources from github.
"""
def __init__(self, fetcher, memcache, blobstore):
@@ -84,8 +84,8 @@ class GithubFileSystem(file_system.FileSystem):
def Stat(self, path):
version = self._memcache.Get(path, memcache.MEMCACHE_GITHUB_STAT)
if version is not None:
- return self.StatInfo(version)
+ return StatInfo(version)
version = json.loads(
self._fetcher.Fetch('commits/HEAD').content)['commit']['tree']['sha']
self._memcache.Set(path, version, memcache.MEMCACHE_GITHUB_STAT)
- return self.StatInfo(version)
+ return StatInfo(version)
« no previous file with comments | « chrome/common/extensions/docs/server2/file_system_cache.py ('k') | chrome/common/extensions/docs/server2/handler.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698