mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
Support a basic update callback system
This commit is contained in:
parent
2a4707d51e
commit
5f3072e67e
7 changed files with 66 additions and 27 deletions
|
@ -98,7 +98,7 @@ pub fn next_update_id(
|
|||
pub fn update_task(
|
||||
writer: &mut rkv::Writer,
|
||||
index: store::Index,
|
||||
mut callback: Option<impl FnOnce(UpdateResult)>,
|
||||
mut callback: Option<impl Fn(UpdateResult)>,
|
||||
) -> MResult<bool>
|
||||
{
|
||||
let (update_id, update) = match index.updates.pop_front(writer)? {
|
||||
|
@ -111,6 +111,7 @@ pub fn update_task(
|
|||
let (update_type, result, duration) = match update {
|
||||
Update::SchemaUpdate(schema) => {
|
||||
let start = Instant::now();
|
||||
|
||||
let update_type = UpdateType::SchemaUpdate { schema: schema.clone() };
|
||||
let result = apply_schema_update(writer, index.main, &schema);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue