Skip to content

Commit

Permalink
reduce cachee times
Browse files Browse the repository at this point in the history
  • Loading branch information
akshay111meher committed Nov 21, 2024
1 parent 936013b commit a4410cd
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion matching_engine/src/routes/ui_routes/dashboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down
2 changes: 1 addition & 1 deletion matching_engine/src/routes/ui_routes/generators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down
2 changes: 1 addition & 1 deletion matching_engine/src/routes/ui_routes/markets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down
2 changes: 1 addition & 1 deletion matching_engine/src/routes/ui_routes/single_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion matching_engine/src/routes/ui_routes/single_market.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit a4410cd

Please sign in to comment.