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

Side by Side Diff: chrome/common/extensions/docs/server2/github_file_system.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 unified diff | Download patch
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import json 5 import json
6 import logging 6 import logging
7 from StringIO import StringIO 7 from StringIO import StringIO
8 import posixpath 8 import posixpath
9 9
10 from appengine_blobstore import AppEngineBlobstore, BLOBSTORE_GITHUB 10 from appengine_blobstore import AppEngineBlobstore, BLOBSTORE_GITHUB
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 try: 193 try:
194 version = json.loads(result.content)['sha'] 194 version = json.loads(result.content)['sha']
195 self._stat_object_store.Set(path, version) 195 self._stat_object_store.Set(path, version)
196 return StatInfo(version) 196 return StatInfo(version)
197 except StandardError as e: 197 except StandardError as e:
198 logging.warning( 198 logging.warning(
199 ('%s: got invalid or unexpected JSON from github. Response status ' + 199 ('%s: got invalid or unexpected JSON from github. Response status ' +
200 'was %s, content %s') % (e, result.status_code, result.content)) 200 'was %s, content %s') % (e, result.status_code, result.content))
201 return self._DefaultStat(path) 201 return self._DefaultStat(path)
202 202
203 def GetIdentity(self): 203 def GetStableIdentity(self):
204 return '%s@%s' % (self.__class__.__name__, StringIdentity(self._url)) 204 return '%s@%s' % (self.__class__.__name__, StringIdentity(self._url))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698