Skip to content

Commit

Permalink
Add Registered Generators count in market info
Browse files Browse the repository at this point in the history
  • Loading branch information
akshay111meher committed Dec 20, 2024
1 parent d7c3e41 commit c3a84a7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,6 @@ test_*.sh

/app
/app/*
*.log
*.log

marketmeta.json
2 changes: 1 addition & 1 deletion matching_engine/src/jobs/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions matching_engine/src/routes/ui_routes/markets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ pub struct Market {
slashing_penalty: Vec<TokenAmount>,
status: bool,
market_setup_data: MarketSetupData,
registered_generators: usize,
}

type CachedMarketResponse = CachedResponse<MarketResponse>;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit c3a84a7

Please sign in to comment.