mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-12-23 13:10:06 +01:00
Update index updated_at information at each update callback
This commit is contained in:
parent
1b8df0ed8b
commit
e22debb994
@ -1,5 +1,6 @@
|
|||||||
use chrono::{DateTime, Utc};
|
use chrono::{DateTime, Utc};
|
||||||
use http::StatusCode;
|
use http::StatusCode;
|
||||||
|
use log::*;
|
||||||
use meilidb_core::ProcessedUpdateResult;
|
use meilidb_core::ProcessedUpdateResult;
|
||||||
use meilidb_schema::Schema;
|
use meilidb_schema::Schema;
|
||||||
use rand::seq::SliceRandom;
|
use rand::seq::SliceRandom;
|
||||||
@ -314,5 +315,11 @@ pub fn index_update_callback(index_uid: &str, data: &Data, _status: ProcessedUpd
|
|||||||
data.compute_stats(&mut writer, &index_uid).unwrap();
|
data.compute_stats(&mut writer, &index_uid).unwrap();
|
||||||
data.set_last_update(&mut writer).unwrap();
|
data.set_last_update(&mut writer).unwrap();
|
||||||
|
|
||||||
|
if let Some(index) = data.db.open_index(&index_uid) {
|
||||||
|
if let Err(e) = index.main.put_updated_at(&mut writer) {
|
||||||
|
error!("Impossible to update updated_at; {}", e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
writer.commit().unwrap();
|
writer.commit().unwrap();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user