Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump deps #1247

Merged
merged 2 commits into from
Sep 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 26 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ web-sys = { version = "0.3.60", features = ["Storage"], optional = true }
[target."cfg(target_arch = \"wasm32\")".dependencies]
getrandom = "0.2.7"
wasm-bindgen = "0.2.83"
wasm-bindgen-futures = "0.4.32"
wasm-bindgen-futures = "0.4.33"
chrono = { version = "0.4.22", default-features = false, features = [] }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ exocore-transport = {version = "0.1.23", path = "../transport", default-features
byteorder = { version = "1.4.3", optional = true }
crc = { version = "3.0.0", optional = true }
extsort = { version = "0.4.2", optional = true }
lru = { version = "0.7.8", optional = true }
lru = { version = "0.8.0", optional = true }
serde = { version = "1.0.144", optional = true }
serde_derive = { version = "1.0.144", optional = true }
serde_json = { version = "1.0.85", optional = true }
Expand Down
4 changes: 2 additions & 2 deletions store/src/local/mutation_index/entity_cache.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::sync::Mutex;
use std::{num::NonZeroUsize, sync::Mutex};

use lru::LruCache;

Expand All @@ -17,7 +17,7 @@ pub struct EntityMutationsCache {
}

impl EntityMutationsCache {
pub fn new(size: usize) -> EntityMutationsCache {
pub fn new(size: NonZeroUsize) -> EntityMutationsCache {
EntityMutationsCache {
cache: Mutex::new(LruCache::new(size)),
}
Expand Down
16 changes: 14 additions & 2 deletions store/src/local/mutation_index/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use std::{
borrow::Borrow,
collections::BTreeMap,
convert::TryInto,
num::NonZeroUsize,
ops::Deref,
path::Path,
result::Result,
Expand Down Expand Up @@ -104,14 +106,19 @@ impl MutationIndex {
index.writer(config.indexer_heap_size_bytes)?
};

let entity_cache_size: NonZeroUsize = config
.entity_mutations_cache_size
.try_into()
.map_err(|err| Error::Other(anyhow!("Invalid entity mutations cache size: {}", err)))?;

Ok(MutationIndex {
config,
index,
index_reader,
index_writer: Mutex::new(index_writer),
schema,
storage: Storage::Disk,
entity_cache: EntityMutationsCache::new(config.entity_mutations_cache_size as usize),
entity_cache: EntityMutationsCache::new(entity_cache_size),
full_text_boost: 1.0,
schema_registry,
})
Expand Down Expand Up @@ -141,14 +148,19 @@ impl MutationIndex {
index.writer(config.indexer_heap_size_bytes)?
};

let entity_cache_size: NonZeroUsize = config
.entity_mutations_cache_size
.try_into()
.map_err(|err| Error::Other(anyhow!("Invalid entity mutations cache size: {}", err)))?;

Ok(MutationIndex {
config,
index,
index_reader,
index_writer: Mutex::new(index_writer),
schema,
storage: Storage::Memory,
entity_cache: EntityMutationsCache::new(config.entity_mutations_cache_size as usize),
entity_cache: EntityMutationsCache::new(entity_cache_size),
full_text_boost: 1.0,
schema_registry,
})
Expand Down