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

Unified Diff: appengine/findit/common/repo_util.py

Issue 2456603003: [Predator] Add local cache for get command output. (Closed)
Patch Set: Fix mock file test. Created 4 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 side-by-side diff with in-line comments
Download patch
Index: appengine/findit/common/repo_util.py
diff --git a/appengine/findit/common/repo_util.py b/appengine/findit/common/repo_util.py
index 511b54be3a7bfaa5675d6e1b1a98b709e234d66f..06e9ff5c83144e1517637ff3f0d7b7fbdb500fd7 100644
--- a/appengine/findit/common/repo_util.py
+++ b/appengine/findit/common/repo_util.py
@@ -8,6 +8,8 @@ import re
import subprocess
import urllib2
+from common import cache_decorator
+
CODE_REVIEW_URL_PATTERN = re.compile(
'^(?:Review URL|Review-Url): (.*\d+).*$', re.IGNORECASE)
COMMIT_POSITION_PATTERN = re.compile(
@@ -76,7 +78,7 @@ def GetRevertedRevision(message):
return reverted_revision_match.group(1)
-# TODO(katesonia): Add local cache for this function.
+@cache_decorator.Cached('Command-output', cacher=cache_decorator.LocalCacher())
def GetCommandOutput(command):
"""Gets the output stream of executable command.

Powered by Google App Engine
This is Rietveld 408576698