Skip to content

Commit

Permalink
fix: cache size
Browse files Browse the repository at this point in the history
  • Loading branch information
lgalabru committed Jun 5, 2023
1 parent 2705b95 commit ce61205
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion components/chainhook-cli/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "chainhook"
version = "0.13.0"
version = "0.14.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
4 changes: 2 additions & 2 deletions components/chainhook-cli/src/cli/mod.rs
Expand Up @@ -644,7 +644,7 @@ async fn handle_command(opts: Opts, ctx: Context) -> Result<(), String> {
};

let transaction_identifier = TransactionIdentifier { hash: txid.clone() };
let traversals_cache = new_traversals_lazy_cache();
let traversals_cache = new_traversals_lazy_cache(1024);
let traversal = retrieve_satoshi_point_using_lazy_storage(
&hord_db_conn,
&block_identifier,
Expand All @@ -666,7 +666,7 @@ async fn handle_command(opts: Opts, ctx: Context) -> Result<(), String> {
let block =
fetch_and_standardize_block(cmd.block_height, &bitcoin_config, &ctx)
.await?;
let traversals_cache = Arc::new(new_traversals_lazy_cache());
let traversals_cache = Arc::new(new_traversals_lazy_cache(1024));

let _traversals = retrieve_inscribed_satoshi_points_from_block(
&block,
Expand Down
6 changes: 5 additions & 1 deletion components/chainhook-event-observer/src/observer/mod.rs
Expand Up @@ -599,7 +599,11 @@ pub async fn start_observer_commands_handler(
let mut chainhooks_lookup: HashMap<String, ApiKey> = HashMap::new();
let networks = (&config.bitcoin_network, &config.stacks_network);
let mut bitcoin_block_store: HashMap<BlockIdentifier, BitcoinBlockData> = HashMap::new();
let traversals_cache = Arc::new(new_traversals_lazy_cache());
let cache_size = config
.hord_config
.and_then(|ref c| Some(c.cache_size))
.unwrap_or(0);
let traversals_cache = Arc::new(new_traversals_lazy_cache(cache_size));

loop {
let command = match observer_commands_rx.recv() {
Expand Down

0 comments on commit ce61205

Please sign in to comment.