mirror of
https://github.com/open-webui/open-webui
synced 2024-11-25 21:38:43 +00:00
refac
This commit is contained in:
parent
c346130774
commit
c292fd89f9
@ -69,7 +69,6 @@ TIMEOUT_DURATION = 3
|
|||||||
async def periodic_usage_pool_cleanup():
|
async def periodic_usage_pool_cleanup():
|
||||||
while True:
|
while True:
|
||||||
now = int(time.time())
|
now = int(time.time())
|
||||||
log.debug(f"Cleaning up usage pool: {now}")
|
|
||||||
for model_id, connections in list(USAGE_POOL.items()):
|
for model_id, connections in list(USAGE_POOL.items()):
|
||||||
# Creating a list of sids to remove if they have timed out
|
# Creating a list of sids to remove if they have timed out
|
||||||
expired_sids = [
|
expired_sids = [
|
||||||
@ -82,6 +81,7 @@ async def periodic_usage_pool_cleanup():
|
|||||||
del connections[sid]
|
del connections[sid]
|
||||||
|
|
||||||
if not connections:
|
if not connections:
|
||||||
|
log.debug(f"Cleaning up model {model_id} from usage pool")
|
||||||
del USAGE_POOL[model_id]
|
del USAGE_POOL[model_id]
|
||||||
else:
|
else:
|
||||||
USAGE_POOL[model_id] = connections
|
USAGE_POOL[model_id] = connections
|
||||||
|
Loading…
Reference in New Issue
Block a user