Prefer using a global update callback common to all indexes

This commit is contained in:
Clément Renault 2019-11-15 17:33:06 +01:00
parent 3a1f41ebdb
commit 23a89732a5
6 changed files with 77 additions and 74 deletions

View file

@ -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)?;