Minor changes
This commit is contained in:
@@ -103,7 +103,8 @@ pub async fn run_analysis(upload_folder: impl Into<std::path::PathBuf>) {
|
|||||||
Ok(i) => i,
|
Ok(i) => i,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
tracing::error!("Polling for next Task: {:?}", e);
|
tracing::error!("Polling for next Task: {:?}", e);
|
||||||
break;
|
tokio::time::sleep(std::time::Duration::from_secs(30)).await;
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -135,7 +136,7 @@ pub async fn run_analysis(upload_folder: impl Into<std::path::PathBuf>) {
|
|||||||
.set(crate::schema::processing_status::dsl::info.eq(1))
|
.set(crate::schema::processing_status::dsl::info.eq(1))
|
||||||
.filter(crate::schema::processing_status::dsl::demo_id.eq(demo_id));
|
.filter(crate::schema::processing_status::dsl::demo_id.eq(demo_id));
|
||||||
|
|
||||||
db_con
|
let store_res = db_con
|
||||||
.transaction::<'_, '_, '_, _, diesel::result::Error, _>(|conn| {
|
.transaction::<'_, '_, '_, _, diesel::result::Error, _>(|conn| {
|
||||||
Box::pin(async move {
|
Box::pin(async move {
|
||||||
for store_fn in store_result_fns {
|
for store_fn in store_result_fns {
|
||||||
@@ -146,9 +147,14 @@ pub async fn run_analysis(upload_folder: impl Into<std::path::PathBuf>) {
|
|||||||
Ok(())
|
Ok(())
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.await
|
.await;
|
||||||
.unwrap();
|
match store_res {
|
||||||
|
Ok(_) => {
|
||||||
tracing::info!("Stored analysis results");
|
tracing::info!("Stored analysis results");
|
||||||
|
}
|
||||||
|
Err(e) => {
|
||||||
|
tracing::error!("Failed to store results: {:?}", e);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user