parser: revert save logic

This commit is contained in:
k
2024-10-27 12:10:22 +01:00
parent 95fc103eaf
commit 36ad0b3014
4 changed files with 12 additions and 15 deletions

View File

@@ -12,7 +12,7 @@ use crate::{
datasets::{AllDatasets, ComputeData},
io::OUTPUTS_FOLDER_PATH,
states::{AddressCohortsDurableStates, States, UTXOCohortsDurableStates},
structs::{DateData, MapKey, Timestamp, RAM},
structs::{DateData, MapKey, Timestamp},
utils::{generate_allocation_files, log, time},
Config, Exit, Height,
};
@@ -57,8 +57,6 @@ pub fn iter_blocks(
let mut block_iter = block_receiver.iter();
let ram = RAM::new();
'parsing: loop {
let instant = Instant::now();
@@ -175,14 +173,11 @@ pub fn iter_blocks(
if is_date_last_block {
height += blocks_loop_i;
let is_check_point = next_block_date.as_ref().map_or(true, |date| {
date.is_first_of_january() || date.is_first_of_june()
});
let is_check_point = next_block_date
.as_ref()
.map_or(true, |date| date.is_first_of_month());
if is_check_point
|| ram.max_exceeded(config)
|| height.is_close_to_end(approx_block_count)
{
if is_check_point || height.is_close_to_end(approx_block_count) {
break 'days;
}

View File

@@ -74,12 +74,16 @@ impl Date {
}
}
pub fn is_first_of_month(&self) -> bool {
self.day() == 1
}
pub fn is_first_of_january(&self) -> bool {
self.day() == 1 && self.month() == 1
self.is_first_of_month() && self.month() == 1
}
pub fn is_first_of_june(&self) -> bool {
self.day() == 1 && self.month() == 6
self.is_first_of_month() && self.month() == 6
}
}

View File

@@ -27,7 +27,6 @@ mod liquidity;
mod map_value;
mod partial_txout_data;
mod price;
mod ram;
mod sent_data;
mod serialized_btreemap;
mod serialized_vec;
@@ -64,7 +63,6 @@ pub use liquidity::*;
pub use map_value::*;
pub use partial_txout_data::*;
pub use price::*;
pub use ram::*;
pub use sent_data::*;
pub use serialized_btreemap::*;
pub use serialized_vec::*;