mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-23 13:24:27 +01:00
fix: Cloned ArcSwaps are unsynchronized versions
This commit is contained in:
parent
cd864c40bc
commit
f45a00df3b
@ -114,7 +114,7 @@ pub struct IndexStats {
|
|||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct Index {
|
pub struct Index {
|
||||||
pub(crate) cache: ArcSwap<Cache>,
|
pub(crate) cache: Arc<ArcSwap<Cache>>,
|
||||||
|
|
||||||
// TODO this will be a snapshot in the future
|
// TODO this will be a snapshot in the future
|
||||||
main_index: MainIndex,
|
main_index: MainIndex,
|
||||||
@ -185,7 +185,7 @@ impl Index {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let cache = Cache { words, synonyms, schema, ranked_map };
|
let cache = Cache { words, synonyms, schema, ranked_map };
|
||||||
let cache = ArcSwap::from_pointee(cache);
|
let cache = Arc::new(ArcSwap::from_pointee(cache));
|
||||||
|
|
||||||
let index = Index {
|
let index = Index {
|
||||||
cache,
|
cache,
|
||||||
|
Loading…
Reference in New Issue
Block a user