Insert new commits into the queue

This commit is contained in:
Joscha 2023-08-06 18:08:04 +02:00
parent 553a56bb12
commit 4f11b9c912
10 changed files with 128 additions and 14 deletions

View file

@ -3,6 +3,7 @@
// TODO `fetch` submodule for fetching new commits
// TODO `queue` submodule for updating the queue
mod queue;
mod repo;
use tracing::{debug_span, error, Instrument};
@ -17,6 +18,14 @@ async fn recurring_task(state: &AppState) {
}
.instrument(debug_span!("update repo"))
.await;
async {
if let Err(e) = queue::update(&state.db).await {
error!("Error updating queue:\n{e:?}");
};
}
.instrument(debug_span!("update queue"))
.await;
}
pub async fn run(state: AppState) {