kin: KIN-INFRA-007 Рефакторинг: убрать дублирование VALID_RUNTIMES и перенести import'ы из функции

This commit is contained in:
Gros Frumos 2026-03-17 18:30:26 +02:00
parent e63703ad33
commit c30a4c0fc4
4 changed files with 9 additions and 8 deletions

View file

@ -761,12 +761,10 @@ def patch_task(task_id: str, body: TaskPatch):
@app.get("/api/pipelines/{pipeline_id}/logs")
def get_pipeline_logs(pipeline_id: int, since_id: int = 0):
"""Get pipeline log entries after since_id (for live console polling)."""
"""Get pipeline log entries after since_id (for live console polling).
Returns [] if pipeline does not exist consistent empty response for log collections.
"""
conn = get_conn()
row = conn.execute("SELECT id FROM pipelines WHERE id = ?", (pipeline_id,)).fetchone()
if not row:
conn.close()
raise HTTPException(404, f"Pipeline {pipeline_id} not found")
logs = models.get_pipeline_logs(conn, pipeline_id, since_id=since_id)
conn.close()
return logs