From 8bf8ca6f529800a0fc93f05ac3622e14fb6cbf1b Mon Sep 17 00:00:00 2001 From: Shreyas Damle Date: Wed, 4 Sep 2024 21:12:21 +0530 Subject: [PATCH] Fixed timeit issue. --- pebblo/app/utils/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pebblo/app/utils/utils.py b/pebblo/app/utils/utils.py index 857554ed..86148769 100644 --- a/pebblo/app/utils/utils.py +++ b/pebblo/app/utils/utils.py @@ -297,6 +297,7 @@ def get_current_time(): def timeit(func): def wrapper(*args, **kwargs): if logger.isEnabledFor(logging.DEBUG): + # Apply time profiling start_time = time.perf_counter() response = func(*args, **kwargs) end_time = time.perf_counter() @@ -305,6 +306,8 @@ def wrapper(*args, **kwargs): ) return response else: - return {} + # Skip time profiling + response = func(*args, **kwargs) + return response return wrapper