fix: Cloned ArcSwaps are unsynchronized versions

This commit is contained in:
Clément Renault 2019-08-23 14:39:55 +02:00 committed by Clément Renault
parent cd864c40bc
commit f45a00df3b
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4

View File

@ -114,7 +114,7 @@ pub struct IndexStats {
#[derive(Clone)]
pub struct Index {
pub(crate) cache: ArcSwap<Cache>,
pub(crate) cache: Arc<ArcSwap<Cache>>,
// TODO this will be a snapshot in the future
main_index: MainIndex,
@ -185,7 +185,7 @@ impl Index {
};
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 {
cache,