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

Side by Side Diff: chrome/common/extensions/docs/server2/new_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 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 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 cStringIO import StringIO 7 from cStringIO import StringIO
8 import posixpath 8 import posixpath
9 import traceback 9 import traceback
10 from zipfile import ZipFile 10 from zipfile import ZipFile
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 version = self._stat_cache.Get(self._repo_key).Get() 278 version = self._stat_cache.Get(self._repo_key).Get()
279 assert version is not None, ('There was a zipball in datastore; there ' 279 assert version is not None, ('There was a zipball in datastore; there '
280 'should be a version cached for it') 280 'should be a version cached for it')
281 281
282 stat_info = StatInfo(version) 282 stat_info = StatInfo(version)
283 if IsDirectory(path): 283 if IsDirectory(path):
284 stat_info.child_versions = dict((p, StatInfo(version)) 284 stat_info.child_versions = dict((p, StatInfo(version))
285 for p in repo_zip.List(path)) 285 for p in repo_zip.List(path))
286 return stat_info 286 return stat_info
287 287
288 def GetIdentity(self): 288 def GetStableIdentity(self):
289 return '%s' % StringIdentity(self.__class__.__name__ + self._repo_key) 289 return '%s' % StringIdentity(self.__class__.__name__ + self._repo_key)
290 290
291 def __repr__(self): 291 def __repr__(self):
292 return '%s(key=%s, url=%s)' % (type(self).__name__, 292 return '%s(key=%s, url=%s)' % (type(self).__name__,
293 self._repo_key, 293 self._repo_key,
294 self._repo_url) 294 self._repo_url)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698