@@ -26,6 +26,11 @@ use serde::{Deserialize, Serialize};
2626use crate :: { kvstore:: mongo:: MongoDbStorage , prelude:: * } ;
2727
2828const DEFAULT_BUCKET_TIMEOUT : u64 = 10 ;
29+ const DEFAULT_CONCURRENCY : usize = 50 ;
30+
31+ pub fn get_default_bucket_timeout ( ) -> u64 {
32+ DEFAULT_BUCKET_TIMEOUT
33+ }
2934
3035pub fn set_source_and_sink_metrics (
3136 sink : & ArchiveArgs ,
@@ -282,8 +287,11 @@ pub struct AwsCliArgs {
282287 // TODO: remove me, concurrency should be handled elsewhere
283288 pub concurrency : usize ,
284289 // If these are not provided, uses timeout_secs for all
290+ #[ serde( default = "get_default_bucket_timeout" ) ]
285291 pub operation_timeout_secs : u64 ,
292+ #[ serde( default = "get_default_bucket_timeout" ) ]
286293 pub operation_attempt_timeout_secs : u64 ,
294+ #[ serde( default = "get_default_bucket_timeout" ) ]
287295 pub read_timeout_secs : u64 ,
288296}
289297
@@ -315,7 +323,7 @@ impl AwsCliArgs {
315323 . remove ( "concurrency" )
316324 . and_then ( |s| usize:: from_str ( & s) . ok ( ) )
317325 // TODO: remove me, concurrency should be handled elsewhere
318- . unwrap_or ( 200 ) ,
326+ . unwrap_or ( DEFAULT_CONCURRENCY ) ,
319327 // If these are not provided, uses timeout_secs for all
320328 operation_timeout_secs : get_u64 ( & kv, "operation-timeout-secs" , timeout_secs) ,
321329 operation_attempt_timeout_secs : get_u64 (
@@ -519,7 +527,7 @@ mod tests {
519527 match a {
520528 BlockDataReaderArgs :: Aws ( args) => {
521529 assert_eq ! ( args. bucket, "my-bucket" ) ;
522- assert_eq ! ( args. concurrency, 200 ) ; // default
530+ assert_eq ! ( args. concurrency, DEFAULT_CONCURRENCY ) ; // default
523531 assert_eq ! ( args. region, None ) ;
524532 }
525533 _ => panic ! ( "expected Aws variant" ) ,
@@ -543,7 +551,7 @@ mod tests {
543551 match a {
544552 BlockDataReaderArgs :: Aws ( args) => {
545553 assert_eq ! ( args. bucket, "my-bucket" ) ;
546- assert_eq ! ( args. concurrency, 200 ) ;
554+ assert_eq ! ( args. concurrency, DEFAULT_CONCURRENCY ) ;
547555 assert_eq ! ( args. region. as_deref( ) , None ) ;
548556 }
549557 _ => panic ! ( "expected Aws variant" ) ,
0 commit comments