mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-12-02 01:55:03 +08:00
fix the index creation in case an index already exists
This commit is contained in:
parent
b3265a8e1f
commit
a8de5368e5
@ -661,6 +661,9 @@ impl IndexScheduler {
|
|||||||
}
|
}
|
||||||
Batch::IndexCreation { index_uid, primary_key, task } => {
|
Batch::IndexCreation { index_uid, primary_key, task } => {
|
||||||
let mut wtxn = self.env.write_txn()?;
|
let mut wtxn = self.env.write_txn()?;
|
||||||
|
if self.index_mapper.exists(&wtxn, &index_uid)? {
|
||||||
|
return Err(Error::IndexAlreadyExists(index_uid));
|
||||||
|
}
|
||||||
self.index_mapper.create_index(&mut wtxn, &index_uid)?;
|
self.index_mapper.create_index(&mut wtxn, &index_uid)?;
|
||||||
wtxn.commit()?;
|
wtxn.commit()?;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user