download log before saving json

This commit is contained in:
Robin Appelman 2026-11-13 00:41:12 +01:00
commit 87a82ef266
Signed by: robin
SSH key fingerprint: SHA256:kifqgrqnut7q1YUIrI0AdMNC23qiKAS/T9uGFmIYvbE

View file

@ -90,6 +90,8 @@ async fn archive(database_url: &str, api_host: &str, log_target: &Path) -> Resul
.await?; .await?;
let body: Value = serde_json::from_str(&response.text().await?)?; let body: Value = serde_json::from_str(&response.text().await?)?;
download_log(api_host, log_target, &client, last_archived).await?;
sqlx::query!( sqlx::query!(
"INSERT INTO logs_raw(id, json) VALUES($1, $2)", "INSERT INTO logs_raw(id, json) VALUES($1, $2)",
last_archived, last_archived,
@ -97,8 +99,6 @@ async fn archive(database_url: &str, api_host: &str, log_target: &Path) -> Resul
) )
.execute(&pool) .execute(&pool)
.await?; .await?;
download_log(api_host, log_target, &client, last_archived).await?;
} }
Ok(()) Ok(())