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

Side by Side Diff: appengine/findit/gae_libs/gitiles/cached_gitiles_repository.py

Issue 2538373003: [Culprit-Finder] Merge lib/ to libs/. (Closed)
Patch Set: Rebase on https://codereview.chromium.org/2557553002/ Created 4 years 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 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 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 functools 5 import functools
6 6
7 from gae_libs.caches import CompressedMemCache 7 from gae_libs.caches import CompressedMemCache
8 from gae_libs.caches import PickledMemCache 8 from gae_libs.caches import PickledMemCache
9 9
10 from lib.cache_decorator import Cached 10 from libs.cache_decorator import Cached
11 from lib.gitiles.gitiles_repository import GitilesRepository 11 from libs.gitiles.gitiles_repository import GitilesRepository
12 12
13 CACHE_EXPIRE_TIME_SECONDS = 24 * 60 * 60 13 CACHE_EXPIRE_TIME_SECONDS = 24 * 60 * 60
14 14
15 15
16 class CachedGitilesRepository(GitilesRepository): 16 class CachedGitilesRepository(GitilesRepository):
17 17
18 @Cached(namespace='Gitiles-json-view', expire_time=CACHE_EXPIRE_TIME_SECONDS, 18 @Cached(namespace='Gitiles-json-view', expire_time=CACHE_EXPIRE_TIME_SECONDS,
19 cache=CompressedMemCache()) 19 cache=CompressedMemCache())
20 def _SendRequestForJsonResponse(self, url, params=None): # pragma: no cover 20 def _SendRequestForJsonResponse(self, url, params=None): # pragma: no cover
21 return super(CachedGitilesRepository, self)._SendRequestForJsonResponse( 21 return super(CachedGitilesRepository, self)._SendRequestForJsonResponse(
22 url, params=params) 22 url, params=params)
23 23
24 @Cached(namespace='Gitiles-text-view', expire_time=CACHE_EXPIRE_TIME_SECONDS, 24 @Cached(namespace='Gitiles-text-view', expire_time=CACHE_EXPIRE_TIME_SECONDS,
25 cache=PickledMemCache()) 25 cache=PickledMemCache())
26 def _SendRequestForTextResponse(self, url): # pragma: no cover 26 def _SendRequestForTextResponse(self, url): # pragma: no cover
27 return super(CachedGitilesRepository, self)._SendRequestForTextResponse(url) 27 return super(CachedGitilesRepository, self)._SendRequestForTextResponse(url)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698