diff --git a/ipa-core/src/bin/report_collector.rs b/ipa-core/src/bin/report_collector.rs index 64aee11f0..fb41fcb9a 100644 --- a/ipa-core/src/bin/report_collector.rs +++ b/ipa-core/src/bin/report_collector.rs @@ -154,8 +154,8 @@ enum ReportCollectorCommand { // If set, use the specified fixed polling interval when running a query. // Otherwise, use exponential backoff. - #[arg(long, default_value_t = 0)] - set_fixed_polling_ms: u64, + #[clap(long)] + set_fixed_polling_ms: Option, }, } @@ -428,7 +428,7 @@ async fn hybrid( helper_clients: Vec<[IpaHttpClient; 3]>, encrypted_inputs: &EncryptedInputs, count: usize, - set_fixed_polling_ms: u64, + set_fixed_polling_ms: Option, ) -> Result<(), Box> { let query_type = QueryType::MaliciousHybrid(hybrid_query_config); diff --git a/ipa-core/src/cli/playbook/hybrid.rs b/ipa-core/src/cli/playbook/hybrid.rs index 53a83b8fd..92d74b383 100644 --- a/ipa-core/src/cli/playbook/hybrid.rs +++ b/ipa-core/src/cli/playbook/hybrid.rs @@ -31,7 +31,7 @@ pub async fn run_hybrid_query_and_validate( clients: Vec<[IpaHttpClient; 3]>, query_id: QueryId, query_config: HybridQueryParams, - set_fixed_polling_ms: u64, + set_fixed_polling_ms: Option, ) -> HybridQueryResult where HV: SharedValue + U128Conversions, @@ -56,11 +56,10 @@ where .unwrap(); let leader_clients = &clients[0]; - let exponential_backoff = set_fixed_polling_ms == 0; - let mut delay = if exponential_backoff { - Duration::from_millis(125) - } else { - Duration::from_millis(set_fixed_polling_ms) + + let (exponential_backoff, mut delay) = match set_fixed_polling_ms { + Some(specified_delay) => (false, Duration::from_millis(specified_delay)), + None => (true, Duration::from_millis(125)), }; loop {