mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
Prefer using a global update callback common to all indexes
This commit is contained in:
parent
3a1f41ebdb
commit
23a89732a5
6 changed files with 77 additions and 74 deletions
|
@ -69,15 +69,6 @@ pub async fn create_index(mut ctx: Context<Data>) -> SResult<Response> {
|
|||
Err(e) => return Err(ResponseError::create_index(e)),
|
||||
};
|
||||
|
||||
let callback_context = ctx.state().clone();
|
||||
let callback_name = index_name.clone();
|
||||
db.set_update_callback(
|
||||
&index_name,
|
||||
Box::new(move |status| {
|
||||
index_update_callback(&callback_name, &callback_context, status);
|
||||
}),
|
||||
);
|
||||
|
||||
let env = &db.env;
|
||||
let mut writer = env.write_txn().map_err(ResponseError::internal)?;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue