store: better caching layer

This commit is contained in:
nym21
2025-12-09 16:37:03 +01:00
parent 96b967f6fb
commit b8f77433b9
3 changed files with 143 additions and 106 deletions
@@ -55,7 +55,7 @@ fn main() -> Result<()> {
loop {
let i = Instant::now();
indexer.checked_index(&blocks, &client, &exit)?;
indexer.index(&blocks, &client, &exit)?;
info!("Done in {:?}", i.elapsed());
sleep(Duration::from_secs(60));
+2 -6
View File
@@ -47,7 +47,7 @@ impl Stores {
let database_ref = &database;
let create_addresshash_to_addressindex_store = |index| {
Store::import(
Store::import_cached(
database_ref,
path,
&format!("h2i{}", index),
@@ -66,7 +66,6 @@ impl Stores {
version,
Mode3::PushOnly,
Kind3::Vec,
0,
)
};
@@ -78,7 +77,6 @@ impl Stores {
version,
Mode3::Any,
Kind3::Vec,
0,
)
};
@@ -92,7 +90,6 @@ impl Stores {
version,
Mode3::PushOnly,
Kind3::Sequential,
0,
)?,
addresstype_to_addresshash_to_addressindex: ByAddressType::new_with_index(
create_addresshash_to_addressindex_store,
@@ -110,9 +107,8 @@ impl Stores {
version,
Mode3::PushOnly,
Kind3::Random,
0,
)?,
txidprefix_to_txindex: Store::import(
txidprefix_to_txindex: Store::import_cached(
database_ref,
path,
"txidprefix_to_txindex",