update the API a little bit

This commit is contained in:
Tamo 2022-10-13 16:21:54 +02:00 committed by Clément Renault
parent 1a3fea4d8c
commit 6fae317277
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
8 changed files with 182 additions and 203 deletions

View file

@ -503,11 +503,12 @@ impl IndexScheduler {
let mut tasks = dump.create_tasks_queue()?;
for ret in self.all_tasks.iter(&rtxn)? {
let (_, task) = ret?;
let mut dump_content_file = tasks.push_task((&task).into())?;
let content_file = task.content_uuid().map(|uuid| uuid.clone());
let mut dump_content_file = tasks.push_task(&task.into())?;
// 2.1. Dump the `content_file` associated with the task if there is one.
if let Some(content_file) = task.content_uuid() {
let content_file = self.file_store.get_update(*content_file)?;
if let Some(content_file) = content_file {
let content_file = self.file_store.get_update(content_file)?;
let reader = DocumentsBatchReader::from_reader(content_file)
.map_err(milli::Error::from)?;

View file

@ -220,6 +220,10 @@ impl IndexScheduler {
Ok(this)
}
pub fn import_dump(&self, dump_path: PathBuf) -> Result<()> {
todo!()
}
/// This function will execute in a different thread and must be called only once.
fn run(&self) {
let run = Self {