Add CI integration.
All checks were successful
rust-test Build rust-test has succeeded
format Build format has succeeded
rust-clippy Build rust-clippy has succeeded
build-poudboot Build build-poudboot has succeeded

This commit is contained in:
Tom Alexander
2024-05-05 21:53:48 -04:00
parent 3a1c25bb19
commit 6542d5f1b5
13 changed files with 1174 additions and 2 deletions

View File

@@ -74,7 +74,7 @@ impl DbHandle {
"WITH next_runs AS (SELECT next_run FROM global_action UNION SELECT next_run FROM local_action) SELECT next_run FROM next_runs ORDER BY next_run ASC",
)?;
let rows = stmt
.query_map(params![], |row| Ok(row.get(0)?))?
.query_map(params![], |row| row.get(0))?
.collect::<Result<Vec<u64>, _>>()?;
if let Some(r) = rows.into_iter().next() {
let next_run = SystemTime::UNIX_EPOCH + Duration::from_secs(r);
@@ -84,6 +84,6 @@ impl DbHandle {
return Ok(next_run.duration_since(now)?);
}
}
return Ok(Duration::from_secs(0));
Ok(Duration::from_secs(0))
}
}

View File

@@ -1,5 +1,6 @@
pub(crate) struct DbGlobalAction {
pub(crate) name: String,
#[allow(dead_code)]
pub(crate) next_run: i64,
}
@@ -8,5 +9,6 @@ pub(crate) struct DbLocalAction {
pub(crate) jail_name: String,
pub(crate) tree: String,
pub(crate) set_name: String,
#[allow(dead_code)]
pub(crate) next_run: i64,
}