Change to meilitool after rebase

This commit is contained in:
Louis Dureuil 2025-01-23 16:59:23 +01:00
parent 182c3f4b80
commit 86bf231d29
No known key found for this signature in database
2 changed files with 12 additions and 12 deletions

View File

@ -187,7 +187,7 @@ fn export_a_dump(
db_path: PathBuf, db_path: PathBuf,
dump_dir: PathBuf, dump_dir: PathBuf,
skip_enqueued_tasks: bool, skip_enqueued_tasks: bool,
detected_version: (String, String, String), detected_version: (u32, u32, u32),
) -> Result<(), anyhow::Error> { ) -> Result<(), anyhow::Error> {
let started_at = OffsetDateTime::now_utc(); let started_at = OffsetDateTime::now_utc();
@ -253,12 +253,7 @@ fn export_a_dump(
if status == Status::Enqueued { if status == Status::Enqueued {
let content_file = file_store.get_update(content_file_uuid)?; let content_file = file_store.get_update(content_file_uuid)?;
if ( if (detected_version.0, detected_version.1, detected_version.2) < (1, 12, 0) {
detected_version.0.as_str(),
detected_version.1.as_str(),
detected_version.2.as_str(),
) < ("1", "12", "0")
{
eprintln!("Dumping the enqueued tasks reading them in obkv format..."); eprintln!("Dumping the enqueued tasks reading them in obkv format...");
let reader = let reader =
DocumentsBatchReader::from_reader(content_file).with_context(|| { DocumentsBatchReader::from_reader(content_file).with_context(|| {

View File

@ -68,8 +68,8 @@ impl OfflineUpgrade {
(1, 9, _) => 0, (1, 9, _) => 0,
(1, 10, _) => 1, (1, 10, _) => 1,
(1, 11, _) => 2, (1, 11, _) => 2,
(1, 12, 0 | 1 | 2) => 3, (1, 12, 0..=2) => 3,
(1, 12, 3 | 4 | 5) => no_upgrade, (1, 12, 3..=5) => no_upgrade,
_ => { _ => {
bail!("Unsupported current version {current_major}.{current_minor}.{current_patch}. Can only upgrade from versions in range [{}-{}]", bail!("Unsupported current version {current_major}.{current_minor}.{current_patch}. Can only upgrade from versions in range [{}-{}]",
FIRST_SUPPORTED_UPGRADE_FROM_VERSION, FIRST_SUPPORTED_UPGRADE_FROM_VERSION,
@ -83,7 +83,7 @@ impl OfflineUpgrade {
(1, 10, _) => 0, (1, 10, _) => 0,
(1, 11, _) => 1, (1, 11, _) => 1,
(1, 12, x) if x == 0 || x == 1 || x == 2 => 2, (1, 12, x) if x == 0 || x == 1 || x == 2 => 2,
(1, 12, 3 | 4 | 5) => 3, (1, 12, 3..=5) => 3,
_ => { _ => {
bail!("Unsupported target version {target_major}.{target_minor}.{target_patch}. Can only upgrade to versions in range [{}-{}]", bail!("Unsupported target version {target_major}.{target_minor}.{target_patch}. Can only upgrade to versions in range [{}-{}]",
FIRST_SUPPORTED_UPGRADE_TO_VERSION, FIRST_SUPPORTED_UPGRADE_TO_VERSION,
@ -95,7 +95,12 @@ impl OfflineUpgrade {
if start_at == no_upgrade { if start_at == no_upgrade {
println!("No upgrade operation to perform, writing VERSION file"); println!("No upgrade operation to perform, writing VERSION file");
create_version_file(&self.db_path, target_major, target_minor, target_patch) create_version_file(
&self.db_path,
&target_major.to_string(),
&target_minor.to_string(),
&target_patch.to_string(),
)
.context("while writing VERSION file after the upgrade")?; .context("while writing VERSION file after the upgrade")?;
println!("Success"); println!("Success");
return Ok(()); return Ok(());