mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
dump the content of the dump tasks instead of recreating at import time with wrong API keys
This commit is contained in:
parent
09a0569228
commit
dbcc3456c6
6 changed files with 54 additions and 37 deletions
|
@ -34,7 +34,7 @@
|
|||
|
||||
use std::{
|
||||
fs::{self, File},
|
||||
io::{BufRead, BufReader},
|
||||
io::{BufRead, BufReader, Seek, SeekFrom},
|
||||
path::Path,
|
||||
};
|
||||
|
||||
|
@ -176,12 +176,11 @@ impl V5Reader {
|
|||
}))
|
||||
}
|
||||
|
||||
pub fn keys(&mut self) -> Box<dyn Iterator<Item = Result<Key>> + '_> {
|
||||
Box::new(
|
||||
(&mut self.keys)
|
||||
.lines()
|
||||
.map(|line| -> Result<_> { Ok(serde_json::from_str(&line?)?) }),
|
||||
)
|
||||
pub fn keys(&mut self) -> Result<Box<dyn Iterator<Item = Result<Key>> + '_>> {
|
||||
self.keys.seek(SeekFrom::Start(0))?;
|
||||
Ok(Box::new((&mut self.keys).lines().map(
|
||||
|line| -> Result<_> { Ok(serde_json::from_str(&line?)?) },
|
||||
)))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue