Merge pull request #3235 from ryanpetrello/sql-profiling

add a custom DB backend that provides system-level SQL profiling

Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
softwarefactory-project-zuul[bot]
2019-02-15 21:56:28 +00:00
committed by GitHub
15 changed files with 391 additions and 10 deletions
+2 -2
View File
@@ -113,13 +113,13 @@ def get_memoize_cache():
return cache
def memoize(ttl=60, cache_key=None, track_function=False):
def memoize(ttl=60, cache_key=None, track_function=False, cache=None):
'''
Decorator to wrap a function and cache its result.
'''
if cache_key and track_function:
raise IllegalArgumentError("Can not specify cache_key when track_function is True")
cache = get_memoize_cache()
cache = cache or get_memoize_cache()
def memoize_decorator(f):
@wraps(f)