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