Cancel session background processes

This commit is contained in:
wuyang6
2026-06-12 16:24:25 +08:00
parent 953126e1d3
commit 0a3e044c9d
4 changed files with 125 additions and 7 deletions
+18
View File
@@ -156,6 +156,24 @@ class BashBgStore:
).fetchall()
return [dict(row) for row in rows]
def list_active_for_session(
self,
account_key: str,
session_id: str,
) -> list[dict[str, Any]]:
with self._connect() as conn:
rows = conn.execute(
"""
select * from bash_bg_tasks
where account_key = ?
and session_id = ?
and status = 'running'
order by started_at desc
""",
(account_key, session_id),
).fetchall()
return [dict(row) for row in rows]
def get(self, task_id: str) -> dict[str, Any] | None:
with self._connect() as conn:
row = conn.execute(