fix: cache size

This commit is contained in:
Ludo Galabru
2023-06-05 11:32:48 -04:00
parent 2705b9501b
commit ce61205b96
3 changed files with 8 additions and 4 deletions

View File

@@ -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

View File

@@ -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,
@@ -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,

View File

@@ -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() {