From 61b9e313d2f415726ac98a0a471fd0231d9ad9ef Mon Sep 17 00:00:00 2001 From: Cyberes Date: Tue, 22 Aug 2023 23:14:56 -0600 Subject: [PATCH] cache again --- llm_server/routes/v1/proxy.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/llm_server/routes/v1/proxy.py b/llm_server/routes/v1/proxy.py index b854bda..76945d9 100644 --- a/llm_server/routes/v1/proxy.py +++ b/llm_server/routes/v1/proxy.py @@ -7,13 +7,15 @@ from llm_server import opts from llm_server.routes.v1.generate import concurrent_semaphore from . import bp from .. import stats +from ..cache import cache +from ..helpers.http import cache_control from ..stats import SemaphoreCheckerThread 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):