From b051f8dd6bc06c6a8a361ababbdb8c5802d524f2 Mon Sep 17 00:00:00 2001 From: Cyberes Date: Tue, 22 Aug 2023 22:42:40 -0600 Subject: [PATCH] remove caching on stats route --- llm_server/routes/stats.py | 1 + llm_server/routes/v1/proxy.py | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/llm_server/routes/stats.py b/llm_server/routes/stats.py index 1a2bfc3..c2fd88d 100644 --- a/llm_server/routes/stats.py +++ b/llm_server/routes/stats.py @@ -31,4 +31,5 @@ class SemaphoreCheckerThread(Thread): self.values.append(0) self.prev_semaphore_value = current_semaphore_value proompters_1_min = sum(self.values) + # print(proompters_1_min) time.sleep(1) diff --git a/llm_server/routes/v1/proxy.py b/llm_server/routes/v1/proxy.py index 1149c08..646044f 100644 --- a/llm_server/routes/v1/proxy.py +++ b/llm_server/routes/v1/proxy.py @@ -14,8 +14,8 @@ from ...llm.info import get_running_model @bp.route('/stats', methods=['GET']) -@cache.cached(timeout=5, query_string=True) -@cache_control(5) +# @cache.cached(timeout=5, query_string=True) +# @cache_control(5) def get_stats(): model_list = get_running_model() # will return False when the fetch fails if isinstance(model_list, bool): @@ -23,6 +23,8 @@ def get_stats(): else: online = True + # print('-->', proompters_1_min) + return jsonify({ 'stats': { 'proompters_now': opts.concurrent_gens - concurrent_semaphore._value,