From af1ecfa7b9911db3a3a8750f7fd20a046db3d1c9 Mon Sep 17 00:00:00 2001 From: iximeow Date: Sat, 1 Jul 2023 15:56:35 -0700 Subject: fix pending jobs query, right number of columns --- src/dbctx.rs | 7 ++++++- src/sql.rs | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/dbctx.rs b/src/dbctx.rs index 331e55f..325bad2 100644 --- a/src/dbctx.rs +++ b/src/dbctx.rs @@ -513,7 +513,12 @@ impl DbCtx { let mut pending = Vec::new(); while let Some(row) = runs.next().unwrap() { - let run = crate::sql::row2run(row).into_pending_run(); + let (id, job_id, create_time) = row.try_into().unwrap(); + let run = PendingRun { + id, + job_id, + create_time, + }; pending.push(run); } diff --git a/src/sql.rs b/src/sql.rs index cc33ad4..e911c96 100644 --- a/src/sql.rs +++ b/src/sql.rs @@ -122,7 +122,7 @@ pub const CREATE_REPO_NAME_INDEX: &'static str = "\ CREATE UNIQUE INDEX IF NOT EXISTS 'repo_names' ON repos(repo_name);"; pub const PENDING_RUNS: &'static str = "\ - select id, job_id, artifacts_path, state, run_host, created_time from runs where state=0;"; + select id, job_id, created_time from runs where state=0;"; pub const ACTIVE_RUNS: &'static str = "\ select id, -- cgit v1.1