Identify queue items by commit hash, not id

This commit is contained in:
Joscha 2023-08-09 16:19:46 +02:00
parent bf08d00922
commit e5de9ccb97
11 changed files with 42 additions and 186 deletions

View file

@ -2,7 +2,7 @@ use sqlx::{Acquire, SqlitePool};
use time::OffsetDateTime;
use tracing::debug;
use crate::{server::util, somehow};
use crate::somehow;
pub async fn update(db: &SqlitePool) -> somehow::Result<()> {
debug!("Updating queue");
@ -17,13 +17,11 @@ pub async fn update(db: &SqlitePool) -> somehow::Result<()> {
// Insert them into the queue
for row in new {
let id = util::new_run_id();
let date = OffsetDateTime::now_utc();
sqlx::query!(
"INSERT INTO queue (id, hash, date) VALUES (?, ?, ?)",
id,
"INSERT INTO queue (hash, date) VALUES (?, ?)",
row.hash,
date
date,
)
.execute(&mut *conn)
.await?;