diff --git a/matching_engine/src/routes/ui_routes/dashboard.rs b/matching_engine/src/routes/ui_routes/dashboard.rs index e70e20b..fb8ca85 100644 --- a/matching_engine/src/routes/ui_routes/dashboard.rs +++ b/matching_engine/src/routes/ui_routes/dashboard.rs @@ -72,7 +72,7 @@ pub async fn get_dashboard( } }; - if let Some(response) = dashboard_cache.get_if_valid(Duration::from_secs(10)) { + if let Some(response) = dashboard_cache.get_if_valid(Duration::from_millis(100)) { // Return the cached response if valid return Ok(HttpResponse::Ok().json(response)); } diff --git a/matching_engine/src/routes/ui_routes/generators.rs b/matching_engine/src/routes/ui_routes/generators.rs index 213c307..81d7bb0 100644 --- a/matching_engine/src/routes/ui_routes/generators.rs +++ b/matching_engine/src/routes/ui_routes/generators.rs @@ -61,7 +61,7 @@ pub async fn get_generators_all( } }; - if let Some(response) = generator_cache.get_if_valid(Duration::from_secs(10)) { + if let Some(response) = generator_cache.get_if_valid(Duration::from_millis(100)) { // Return the cached response if valid return Ok(HttpResponse::Ok().json(response)); } diff --git a/matching_engine/src/routes/ui_routes/markets.rs b/matching_engine/src/routes/ui_routes/markets.rs index e14ee04..c20a4ae 100644 --- a/matching_engine/src/routes/ui_routes/markets.rs +++ b/matching_engine/src/routes/ui_routes/markets.rs @@ -65,7 +65,7 @@ pub async fn total_market_info( } }; - if let Some(response) = market_cache.get_if_valid(Duration::from_secs(10)) { + if let Some(response) = market_cache.get_if_valid(Duration::from_millis(100)) { // Return the cached response if valid return Ok(HttpResponse::Ok().json(response)); } diff --git a/matching_engine/src/routes/ui_routes/single_generator.rs b/matching_engine/src/routes/ui_routes/single_generator.rs index e950f86..cb7cef1 100644 --- a/matching_engine/src/routes/ui_routes/single_generator.rs +++ b/matching_engine/src/routes/ui_routes/single_generator.rs @@ -205,7 +205,7 @@ pub async fn single_generator( }; let cached_response = match SINGLE_GENERATOR_RESPONSE.try_read() { - Ok(data) => data.get(&generator_query, Duration::from_secs(10)), + Ok(data) => data.get(&generator_query, Duration::from_millis(100)), _ => { return Ok(HttpResponse::Locked().json(WelcomeResponse { status: "Resource Busy".into(), diff --git a/matching_engine/src/routes/ui_routes/single_market.rs b/matching_engine/src/routes/ui_routes/single_market.rs index d650bdb..93a5ece 100644 --- a/matching_engine/src/routes/ui_routes/single_market.rs +++ b/matching_engine/src/routes/ui_routes/single_market.rs @@ -143,7 +143,7 @@ pub async fn single_market( }; let cached_response = match SINGLE_MARKET_RESPONSE.try_read() { - Ok(data) => data.get(&market_query, Duration::from_secs(10)), + Ok(data) => data.get(&market_query, Duration::from_millis(100)), _ => { return Ok(HttpResponse::Locked().json(WelcomeResponse { status: "Resource Busy".into(),