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

Unified Diff: appengine/findit/util_scripts/script_util.py

Issue 2456603003: [Predator] Add local cache for get command output. (Closed)
Patch Set: Rebase. Created 4 years, 1 month 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/util_scripts/script_util.py
diff --git a/appengine/findit/util_scripts/script_util.py b/appengine/findit/util_scripts/script_util.py
index dc4da5cf06aa4618ecacfb9279df174e69ab996d..1386357d9855ef952e71c8400febace7bac7b282 100644
--- a/appengine/findit/util_scripts/script_util.py
+++ b/appengine/findit/util_scripts/script_util.py
@@ -9,6 +9,9 @@ import os
import subprocess
import sys
+from lib.cache_decorator import Cached
+from local_cache import LocalCacher # pylint: disable=W
+
def SetUpSystemPaths(): # pragma: no cover
"""Sets system paths so as to import modules in findit, third_party and
@@ -29,8 +32,8 @@ def SetUpSystemPaths(): # pragma: no cover
sys.path.insert(1, findit_root_dir)
-# TODO(katesonia): Add local cache for this function.
-def GetCommandOutput(command):
+@Cached(namespace='Command-output', cacher=LocalCacher())
+def GetCommandOutput(command): # pragma: no cover
"""Gets the output stream of executable command.
Args:
« no previous file with comments | « appengine/findit/util_scripts/local_cache.py ('k') | appengine/findit/util_scripts/test/local_cache_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698