remove caching on stats route

This commit is contained in:
Cyberes 2023-08-22 22:42:40 -06:00
parent 9f14b166dd
commit b051f8dd6b
2 changed files with 5 additions and 2 deletions

View File

@ -31,4 +31,5 @@ class SemaphoreCheckerThread(Thread):
self.values.append(0) self.values.append(0)
self.prev_semaphore_value = current_semaphore_value self.prev_semaphore_value = current_semaphore_value
proompters_1_min = sum(self.values) proompters_1_min = sum(self.values)
# print(proompters_1_min)
time.sleep(1) time.sleep(1)

View File

@ -14,8 +14,8 @@ from ...llm.info import get_running_model
@bp.route('/stats', methods=['GET']) @bp.route('/stats', methods=['GET'])
@cache.cached(timeout=5, query_string=True) # @cache.cached(timeout=5, query_string=True)
@cache_control(5) # @cache_control(5)
def get_stats(): def get_stats():
model_list = get_running_model() # will return False when the fetch fails model_list = get_running_model() # will return False when the fetch fails
if isinstance(model_list, bool): if isinstance(model_list, bool):
@ -23,6 +23,8 @@ def get_stats():
else: else:
online = True online = True
# print('-->', proompters_1_min)
return jsonify({ return jsonify({
'stats': { 'stats': {
'proompters_now': opts.concurrent_gens - concurrent_semaphore._value, 'proompters_now': opts.concurrent_gens - concurrent_semaphore._value,