review changes

This commit is contained in:
mpostma
2021-06-10 15:55:44 +02:00
parent eb7616ca0f
commit 3ef0830c5d
6 changed files with 9 additions and 7 deletions

View File

@ -40,6 +40,8 @@ impl MapIndexStore {
#[async_trait::async_trait]
impl IndexStore for MapIndexStore {
async fn create(&self, uuid: Uuid, primary_key: Option<String>) -> IndexResult<Index> {
// We need to keep the lock until we are sure the db file has been opened correclty, to
// ensure that another db is not created at the same time.
let mut lock = self.index_store.write().await;
if let Some(index) = lock.get(&uuid) {