remove caching on stats route
This commit is contained in:
parent
9f14b166dd
commit
b051f8dd6b
|
@ -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)
|
||||||
|
|
|
@ -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,
|
||||||
|
|
Reference in New Issue