Keep running jobs visible when the job list is cleared

This commit is contained in:
justin committed 2026-09-21 14:53:56 -07:00
1 parent 2c5a1599c2
commit 82269d66f6
1 file changed
+3 -2
+3 -2
View File
@@ -2022,9 +2022,10 @@ async def api_pull_model(request: Request):
def api_clear_history(): def api_clear_history():
with state_lock: with state_lock:
st = load_state() st = load_state()
count = len(st["history"]) keep = [h for h in st["history"] if h.get("status") == "running"]
count = len(st["history"]) - len(keep)
if count: if count:
st["history"] = [] st["history"] = keep
save_state(st) save_state(st)
if count: if count:
logger.info("Cleared %d jobs from the list", count) logger.info("Cleared %d jobs from the list", count)