fix update files created in the wrong place

This commit is contained in:
mpostma 2021-03-03 14:39:44 +01:00
parent e285404c3e
commit 3cd799a744
No known key found for this signature in database
GPG Key ID: CBC8A7C1D7A28C3A
4 changed files with 11 additions and 6 deletions

View File

@ -59,7 +59,9 @@ impl ApiKeys {
impl Data { impl Data {
pub fn new(options: Opt) -> anyhow::Result<Data> { pub fn new(options: Opt) -> anyhow::Result<Data> {
let path = options.db_path.clone(); let path = options.db_path.clone();
//let indexer_opts = options.indexer_options.clone(); //let indexer_opts = options.indexer_options.clone();
create_dir_all(&path)?; create_dir_all(&path)?;
let index_controller = IndexController::new(&path); let index_controller = IndexController::new(&path);

View File

@ -196,10 +196,10 @@ pub struct IndexActorHandle {
} }
impl IndexActorHandle { impl IndexActorHandle {
pub fn new() -> Self { pub fn new(path: impl AsRef<Path>) -> Self {
let (sender, receiver) = mpsc::channel(100); let (sender, receiver) = mpsc::channel(100);
let store = MapIndexStore::new("data.ms"); let store = MapIndexStore::new(path);
let actor = IndexActor::new(receiver, store); let actor = IndexActor::new(receiver, store);
tokio::task::spawn(actor.run()); tokio::task::spawn(actor.run());
Self { sender } Self { sender }

View File

@ -33,7 +33,7 @@ enum IndexControllerMsg {
impl IndexController { impl IndexController {
pub fn new(path: impl AsRef<Path>) -> Self { pub fn new(path: impl AsRef<Path>) -> Self {
let uuid_resolver = uuid_resolver::UuidResolverHandle::new(); let uuid_resolver = uuid_resolver::UuidResolverHandle::new();
let index_actor = index_actor::IndexActorHandle::new(); let index_actor = index_actor::IndexActorHandle::new(&path);
let update_handle = update_actor::UpdateActorHandle::new(index_actor.clone(), &path); let update_handle = update_actor::UpdateActorHandle::new(index_actor.clone(), &path);
Self { uuid_resolver, index_handle: index_actor, update_handle } Self { uuid_resolver, index_handle: index_actor, update_handle }
} }

View File

@ -112,9 +112,12 @@ where D: AsRef<[u8]> + Sized + 'static,
let (sender, receiver) = mpsc::channel(100); let (sender, receiver) = mpsc::channel(100);
let mut options = heed::EnvOpenOptions::new(); let mut options = heed::EnvOpenOptions::new();
options.map_size(4096 * 100_000); options.map_size(4096 * 100_000);
let mut path = PathBuf::new();
path.push("data.ms"); let path = path
path.push("updates"); .as_ref()
.to_owned()
.join("updates");
create_dir_all(&path).unwrap(); create_dir_all(&path).unwrap();
let index_handle_clone = index_handle.clone(); let index_handle_clone = index_handle.clone();
let store = UpdateStore::open(options, &path, move |meta, file| { let store = UpdateStore::open(options, &path, move |meta, file| {