diff --git a/app/runtime.py b/app/runtime.py index ff10eaf..bf6ce63 100644 --- a/app/runtime.py +++ b/app/runtime.py @@ -745,8 +745,15 @@ def terminate_session_record( return old_status = sess.status cid = sess.container_id or "" - if stop_container and cid and not cid.startswith(("POOL:", "POOLIDX:", "WEBPOOLIDX:", "RDPSLOT:")): - stop_runtime_container(cid) + if stop_container and cid: + if cid.startswith("WEBPOOLIDX:"): + try: + slot = int(cid.split(":", 1)[1]) + threading.Thread(target=stop_runtime_container, args=(web_pool_container_name(slot),), daemon=True).start() + except Exception: + logger.exception("webpool_slot_recycle_failed cid=%s", cid) + elif not cid.startswith(("POOL:", "POOLIDX:", "RDPSLOT:")): + stop_runtime_container(cid) if cid.startswith("RDPSLOT:"): try: slot_id = int(cid.split(":", 1)[1])