life jobs logs

This commit is contained in:
JiriUhlir
2026-05-29 11:02:43 +02:00
parent e3019bd76e
commit 0dcf9b7b05
3 changed files with 166 additions and 6 deletions
+20
View File
@@ -346,6 +346,26 @@ def get_job_logs(job_id: int, limit: int = 1000):
return [dict(row) for row in rows]
def get_job_logs_after(job_id: int, last_log_id: int = 0, limit: int = 100):
run_migrations()
con = get_connection()
rows = con.execute(
"""
SELECT *
FROM job_logs
WHERE job_id = ?
AND id > ?
ORDER BY id
LIMIT ?
""",
(job_id, last_log_id, limit),
).fetchall()
con.close()
return [dict(row) for row in rows]
def has_active_deploy_job(target_type: str, target_id: str):
run_migrations()
con = get_connection()