From ea7285c4d46154552aa3b1996f05bb44e52153f4 Mon Sep 17 00:00:00 2001 From: gnalh Date: Tue, 30 Apr 2024 23:30:05 +0000 Subject: [PATCH] update --- src/clients.rs | 2 +- src/main.rs | 16 +++++++++++----- src/types.rs | 3 ++- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/clients.rs b/src/clients.rs index c24b48d4..7b4bbf52 100644 --- a/src/clients.rs +++ b/src/clients.rs @@ -81,7 +81,7 @@ pub async fn get_quarantine_bulk_test_status( resp.json::() .await - .context("Failed to get repsonse body as json") + .context("Failed to get response body as json") } /// Puts file to S3 using pre-signed link. diff --git a/src/main.rs b/src/main.rs index 6f80a74f..fbc96f30 100644 --- a/src/main.rs +++ b/src/main.rs @@ -337,7 +337,7 @@ async fn run_test(test_args: TestArgs) -> anyhow::Result { quarantine_results: Vec::new(), } } else { - Retry::spawn(default_delay(), || { + match Retry::spawn(default_delay(), || { get_quarantine_bulk_test_status( &api_address, token, @@ -347,10 +347,16 @@ async fn run_test(test_args: TestArgs) -> anyhow::Result { ) }) .await - .unwrap_or(QuarantineBulkTestStatus { - group_is_quarantined: false, - quarantine_results: Vec::new(), - }) + { + Ok(quarantine_results) => quarantine_results, + Err(e) => { + log::error!("Failed to get quarantine results: {:?}", e); + QuarantineBulkTestStatus { + group_is_quarantined: false, + quarantine_results: Vec::new(), + } + } + } }; log::info!("Quarantine results: {:?}", quarantine_results); diff --git a/src/types.rs b/src/types.rs index 66c6776e..5f7d8682 100644 --- a/src/types.rs +++ b/src/types.rs @@ -37,9 +37,10 @@ pub struct Test { #[derive(Debug, Serialize, Clone, Deserialize)] pub struct QuarantineResult { pub name: String, + #[serde(rename = "parentName")] pub parent_name: String, #[serde(rename = "quarantinedSince")] - pub quarantined_since: i64, + pub quarantined_since: String, pub file: String, #[serde(rename = "className")] pub class_name: String,