mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-26 07:39:59 -07:00
vecs: part 10
This commit is contained in:
@@ -3,13 +3,13 @@
|
||||
#![doc = include_str!("../examples/main.rs")]
|
||||
#![doc = "```"]
|
||||
|
||||
use std::path::Path;
|
||||
use std::{path::Path, sync::Arc};
|
||||
|
||||
use brk_core::Version;
|
||||
use brk_exit::Exit;
|
||||
use brk_fetcher::Fetcher;
|
||||
use brk_indexer::Indexer;
|
||||
use brk_vec::{Computation, Format};
|
||||
use brk_vecs::{Computation, File, Format};
|
||||
use log::info;
|
||||
|
||||
mod all;
|
||||
@@ -47,15 +47,22 @@ impl Computer {
|
||||
fetcher: Option<Fetcher>,
|
||||
format: Format,
|
||||
) -> color_eyre::Result<Self> {
|
||||
let computed_path = outputs_dir.join("computed");
|
||||
let states_path = computed_path.join("states");
|
||||
|
||||
let file = Arc::new(File::open(&computed_path.join("vecs"))?);
|
||||
let file_fetched = Arc::new(File::open(&outputs_dir.join("fetched/vecs"))?);
|
||||
|
||||
Ok(Self {
|
||||
vecs: all::Vecs::import(
|
||||
// TODO: Give self.path, join inside import
|
||||
&outputs_dir.join("vecs/computed"),
|
||||
&file,
|
||||
VERSION + Version::ZERO,
|
||||
indexer,
|
||||
fetcher.is_some(),
|
||||
computation,
|
||||
format,
|
||||
&file_fetched,
|
||||
&states_path,
|
||||
)?,
|
||||
fetcher,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user