mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-08-02 03:40:00 +00:00
dump the content of the dump tasks instead of recreating at import time with wrong API keys
This commit is contained in:
@ -1,8 +1,10 @@
|
||||
use meilisearch_types::{
|
||||
error::ResponseError,
|
||||
keys::Key,
|
||||
milli::update::IndexDocumentsMethod,
|
||||
settings::Unchecked,
|
||||
tasks::{Details, KindWithContent, Status, Task, TaskId},
|
||||
InstanceUid,
|
||||
};
|
||||
use roaring::RoaringBitmap;
|
||||
use serde::{Deserialize, Serialize};
|
||||
@ -120,6 +122,8 @@ pub enum KindDump {
|
||||
},
|
||||
DumpExport {
|
||||
dump_uid: String,
|
||||
keys: Vec<Key>,
|
||||
instance_uid: Option<InstanceUid>,
|
||||
},
|
||||
Snapshot,
|
||||
}
|
||||
@ -181,7 +185,15 @@ impl From<KindWithContent> for KindDump {
|
||||
KindWithContent::TaskDeletion { query, tasks } => {
|
||||
KindDump::DeleteTasks { query, tasks }
|
||||
}
|
||||
KindWithContent::DumpExport { dump_uid, .. } => KindDump::DumpExport { dump_uid },
|
||||
KindWithContent::DumpExport {
|
||||
dump_uid,
|
||||
keys,
|
||||
instance_uid,
|
||||
} => KindDump::DumpExport {
|
||||
dump_uid,
|
||||
keys,
|
||||
instance_uid,
|
||||
},
|
||||
KindWithContent::Snapshot => KindDump::Snapshot,
|
||||
}
|
||||
}
|
||||
@ -444,7 +456,7 @@ pub(crate) mod test {
|
||||
drop(indexes);
|
||||
|
||||
// ==== checking the task queue
|
||||
for (task, expected) in dump.tasks().zip(create_test_tasks()) {
|
||||
for (task, expected) in dump.tasks().unwrap().zip(create_test_tasks()) {
|
||||
let (task, content_file) = task.unwrap();
|
||||
assert_eq!(task, expected.0);
|
||||
|
||||
@ -463,7 +475,7 @@ pub(crate) mod test {
|
||||
}
|
||||
|
||||
// ==== checking the keys
|
||||
for (key, expected) in dump.keys().zip(create_test_api_keys()) {
|
||||
for (key, expected) in dump.keys().unwrap().zip(create_test_api_keys()) {
|
||||
assert_eq!(key.unwrap(), expected);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user