Function
update_agent_run_status
(db: &SqlitePool, id: &str, status: &str)
Source from the content-addressed store, hash-verified
| 49 | } |
| 50 | |
| 51 | pub async fn update_agent_run_status(db: &SqlitePool, id: &str, status: &str) -> AppResult<()> { |
| 52 | let result = sqlx::query("UPDATE agent_runs SET status = ?1 WHERE id = ?2") |
| 53 | .bind(status) |
| 54 | .bind(id) |
| 55 | .execute(db) |
| 56 | .await?; |
| 57 | |
| 58 | if result.rows_affected() == 0 { |
| 59 | return Err(AppError::NotFound(format!("Agent run not found: {id}"))); |
| 60 | } |
| 61 | |
| 62 | Ok(()) |
| 63 | } |
| 64 | |
| 65 | pub async fn complete_agent_run(db: &SqlitePool, id: &str, output: &str) -> AppResult<()> { |
| 66 | let now = now_rfc3339(); |
Tested by
no test coverage detected