Keep IndexUidPattern

This commit is contained in:
Mubelotix 2025-07-01 14:47:43 +02:00
parent 25c19a306b
commit 37a692f942
No known key found for this signature in database
GPG key ID: 0406DF6C3A69B942
2 changed files with 9 additions and 9 deletions

View file

@ -30,7 +30,7 @@ impl IndexScheduler {
payload_size: Option<&Byte>, payload_size: Option<&Byte>,
indexes: &BTreeMap<IndexUidPattern, ExportIndexSettings>, indexes: &BTreeMap<IndexUidPattern, ExportIndexSettings>,
progress: Progress, progress: Progress,
) -> Result<BTreeMap<String, DetailsExportIndexSettings>> { ) -> Result<BTreeMap<IndexUidPattern, DetailsExportIndexSettings>> {
#[cfg(test)] #[cfg(test)]
self.maybe_fail(crate::test_utils::FailureLocation::ProcessExport)?; self.maybe_fail(crate::test_utils::FailureLocation::ProcessExport)?;
@ -157,7 +157,7 @@ impl IndexScheduler {
progress.update_progress(progress_step); progress.update_progress(progress_step);
output.insert( output.insert(
uid.clone(), IndexUidPattern::new_unchecked(uid.clone()),
DetailsExportIndexSettings { DetailsExportIndexSettings {
settings: (*export_settings).clone(), settings: (*export_settings).clone(),
matched_documents: Some(total_documents as u64), matched_documents: Some(total_documents as u64),

View file

@ -289,12 +289,12 @@ impl KindWithContent {
}), }),
KindWithContent::DumpCreation { .. } => Some(Details::Dump { dump_uid: None }), KindWithContent::DumpCreation { .. } => Some(Details::Dump { dump_uid: None }),
KindWithContent::SnapshotCreation => None, KindWithContent::SnapshotCreation => None,
KindWithContent::Export { url, api_key, payload_size, indexes: _ } => { KindWithContent::Export { url, api_key, payload_size, indexes } => {
Some(Details::Export { Some(Details::Export {
url: url.clone(), url: url.clone(),
api_key: api_key.clone(), api_key: api_key.clone(),
payload_size: *payload_size, payload_size: *payload_size,
indexes: BTreeMap::new(), indexes: indexes.iter().map(|(p, s)| (p.clone(), s.clone().into())).collect(),
}) })
} }
KindWithContent::UpgradeDatabase { from } => Some(Details::UpgradeDatabase { KindWithContent::UpgradeDatabase { from } => Some(Details::UpgradeDatabase {
@ -363,12 +363,12 @@ impl KindWithContent {
}), }),
KindWithContent::DumpCreation { .. } => Some(Details::Dump { dump_uid: None }), KindWithContent::DumpCreation { .. } => Some(Details::Dump { dump_uid: None }),
KindWithContent::SnapshotCreation => None, KindWithContent::SnapshotCreation => None,
KindWithContent::Export { url, api_key, payload_size, indexes: _ } => { KindWithContent::Export { url, api_key, payload_size, indexes } => {
Some(Details::Export { Some(Details::Export {
url: url.clone(), url: url.clone(),
api_key: api_key.clone(), api_key: api_key.clone(),
payload_size: *payload_size, payload_size: *payload_size,
indexes: BTreeMap::new(), indexes: indexes.iter().map(|(p, s)| (p.clone(), s.clone().into())).collect(),
}) })
} }
KindWithContent::UpgradeDatabase { from } => Some(Details::UpgradeDatabase { KindWithContent::UpgradeDatabase { from } => Some(Details::UpgradeDatabase {
@ -419,12 +419,12 @@ impl From<&KindWithContent> for Option<Details> {
}), }),
KindWithContent::DumpCreation { .. } => Some(Details::Dump { dump_uid: None }), KindWithContent::DumpCreation { .. } => Some(Details::Dump { dump_uid: None }),
KindWithContent::SnapshotCreation => None, KindWithContent::SnapshotCreation => None,
KindWithContent::Export { url, api_key, payload_size, indexes: _ } => { KindWithContent::Export { url, api_key, payload_size, indexes } => {
Some(Details::Export { Some(Details::Export {
url: url.clone(), url: url.clone(),
api_key: api_key.clone(), api_key: api_key.clone(),
payload_size: *payload_size, payload_size: *payload_size,
indexes: BTreeMap::new(), indexes: indexes.iter().map(|(p, s)| (p.clone(), s.clone().into())).collect(),
}) })
} }
KindWithContent::UpgradeDatabase { from } => Some(Details::UpgradeDatabase { KindWithContent::UpgradeDatabase { from } => Some(Details::UpgradeDatabase {
@ -696,7 +696,7 @@ pub enum Details {
url: String, url: String,
api_key: Option<String>, api_key: Option<String>,
payload_size: Option<Byte>, payload_size: Option<Byte>,
indexes: BTreeMap<String, DetailsExportIndexSettings>, indexes: BTreeMap<IndexUidPattern, DetailsExportIndexSettings>,
}, },
UpgradeDatabase { UpgradeDatabase {
from: (u32, u32, u32), from: (u32, u32, u32),