From c3a84a7877383ff26a687a8a49cfa84195c13335 Mon Sep 17 00:00:00 2001 From: Akshay Date: Fri, 20 Dec 2024 08:50:21 +0000 Subject: [PATCH] Add Registered Generators count in market info --- .gitignore | 4 +++- matching_engine/src/jobs/parser.rs | 2 +- matching_engine/src/routes/ui_routes/markets.rs | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 80f5bd7..6e0bc28 100644 --- a/.gitignore +++ b/.gitignore @@ -38,4 +38,6 @@ test_*.sh /app /app/* -*.log \ No newline at end of file +*.log + +marketmeta.json \ No newline at end of file diff --git a/matching_engine/src/jobs/parser.rs b/matching_engine/src/jobs/parser.rs index a405ced..8b3a077 100644 --- a/matching_engine/src/jobs/parser.rs +++ b/matching_engine/src/jobs/parser.rs @@ -188,7 +188,7 @@ impl LogParser { time_since_last_backup.as_secs_f64() ); - if time_since_last_backup > tokio::time::Duration::from_secs(300) { + if time_since_last_backup > tokio::time::Duration::from_secs(60 * 15) { // make backup here let market_store = self.shared_market_store.read().await; let ask_store = self.shared_local_ask_store.read().await; diff --git a/matching_engine/src/routes/ui_routes/markets.rs b/matching_engine/src/routes/ui_routes/markets.rs index 7240aae..8c3289f 100644 --- a/matching_engine/src/routes/ui_routes/markets.rs +++ b/matching_engine/src/routes/ui_routes/markets.rs @@ -37,6 +37,7 @@ pub struct Market { slashing_penalty: Vec, status: bool, market_setup_data: MarketSetupData, + registered_generators: usize, } type CachedMarketResponse = CachedResponse; @@ -225,6 +226,7 @@ async fn recompute_market_response<'a>( slashing_penalty: slashing_penalty.to_token_amount(), status: true, // Adjust as needed market_setup_data: meta.deserialize_market_bytes(), + registered_generators: local_generator_store.get_all_by_market_id(&market_id).len(), }; markets.push(market);