mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-30 09:04:59 +08:00
Merge pull request #439 from meilisearch/fix-update-deadlock
Fix a blocking channel, appearing like a deadlock
This commit is contained in:
commit
534143e91d
@ -168,7 +168,7 @@ impl Database {
|
|||||||
// open the previously aggregated indexes
|
// open the previously aggregated indexes
|
||||||
let mut indexes = HashMap::new();
|
let mut indexes = HashMap::new();
|
||||||
for index_uid in must_open {
|
for index_uid in must_open {
|
||||||
let (sender, receiver) = crossbeam_channel::bounded(100);
|
let (sender, receiver) = crossbeam_channel::unbounded();
|
||||||
let index = match store::open(&env, &update_env, &index_uid, sender.clone())? {
|
let index = match store::open(&env, &update_env, &index_uid, sender.clone())? {
|
||||||
Some(index) => index,
|
Some(index) => index,
|
||||||
None => {
|
None => {
|
||||||
@ -233,7 +233,7 @@ impl Database {
|
|||||||
match indexes_lock.entry(name.to_owned()) {
|
match indexes_lock.entry(name.to_owned()) {
|
||||||
Entry::Occupied(_) => Err(crate::Error::IndexAlreadyExists),
|
Entry::Occupied(_) => Err(crate::Error::IndexAlreadyExists),
|
||||||
Entry::Vacant(entry) => {
|
Entry::Vacant(entry) => {
|
||||||
let (sender, receiver) = crossbeam_channel::bounded(100);
|
let (sender, receiver) = crossbeam_channel::unbounded();
|
||||||
let index = store::create(&self.env, &self.update_env, name, sender)?;
|
let index = store::create(&self.env, &self.update_env, name, sender)?;
|
||||||
|
|
||||||
let mut writer = self.env.typed_write_txn::<MainT>()?;
|
let mut writer = self.env.typed_write_txn::<MainT>()?;
|
||||||
|
Loading…
Reference in New Issue
Block a user