rebase on index-scheduler

This commit is contained in:
Tamo 2022-10-17 15:11:35 +02:00 committed by Clément Renault
parent e0221fc0a3
commit d0e91555d1
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4
7 changed files with 12 additions and 6 deletions

View File

@ -21,6 +21,7 @@ meilisearch-types = { path = "../meilisearch-types" }
http = "0.2.8"
regex = "1.6.0"
lazy_static = "1.4.0"
roaring = { version = "0.10.0", features = ["serde"] }
[dev-dependencies]
big_s = "1.0.2"

View File

@ -4,6 +4,7 @@ use meilisearch_types::{
settings::Unchecked,
tasks::{Details, KindWithContent, Status, Task, TaskId},
};
use roaring::RoaringBitmap;
use serde::{Deserialize, Serialize};
use time::OffsetDateTime;
@ -115,7 +116,7 @@ pub enum KindDump {
},
DeleteTasks {
query: String,
tasks: Vec<TaskId>,
tasks: RoaringBitmap,
},
DumpExport {
dump_uid: String,
@ -177,7 +178,9 @@ impl From<KindWithContent> for KindDump {
}
KindWithContent::IndexSwap { lhs, rhs } => KindDump::IndexSwap { lhs, rhs },
KindWithContent::CancelTask { tasks } => KindDump::CancelTask { tasks },
KindWithContent::DeleteTasks { query, tasks } => KindDump::DeleteTasks { query, tasks },
KindWithContent::TaskDeletion { query, tasks } => {
KindDump::DeleteTasks { query, tasks }
}
KindWithContent::DumpExport { dump_uid, .. } => KindDump::DumpExport { dump_uid },
KindWithContent::Snapshot => KindDump::Snapshot,
}

View File

@ -480,7 +480,7 @@ impl IndexScheduler {
KindDump::IndexSwap { lhs, rhs } => KindWithContent::IndexSwap { lhs, rhs },
KindDump::CancelTask { tasks } => KindWithContent::CancelTask { tasks },
KindDump::DeleteTasks { query, tasks } => {
KindWithContent::DeleteTasks { query, tasks }
KindWithContent::TaskDeletion { query, tasks }
}
KindDump::DumpExport { dump_uid } => KindWithContent::DumpExport {
dump_uid,

View File

@ -14,3 +14,4 @@ sha2 = "0.10.6"
thiserror = "1.0.37"
time = { version = "0.3.15", features = ["serde-well-known", "formatting", "parsing", "macros"] }
uuid = { version = "1.1.2", features = ["serde", "v4"] }
roaring = { version = "0.10.0", features = ["serde"] }

View File

@ -18,7 +18,7 @@ pub enum AuthControllerError {
}
internal_error!(
AuthControllerError: milli::heed::Error,
AuthControllerError: meilisearch_types::milli::heed::Error,
std::io::Error,
serde_json::Error,
std::str::Utf8Error

View File

@ -11,6 +11,7 @@ use std::sync::Arc;
use hmac::{Hmac, Mac};
use meilisearch_types::keys::KeyId;
use meilisearch_types::milli;
use meilisearch_types::star_or::StarOr;
use meilisearch_types::milli;
use milli::heed::types::{ByteSlice, DecodeIgnore, SerdeJson};

View File

@ -87,7 +87,7 @@ impl Task {
| KindWithContent::IndexUpdate { .. }
| KindWithContent::IndexSwap { .. }
| KindWithContent::CancelTask { .. }
| KindWithContent::DeleteTasks { .. }
| KindWithContent::TaskDeletion { .. }
| KindWithContent::DumpExport { .. }
| KindWithContent::Snapshot => None,
}
@ -250,7 +250,7 @@ impl From<&KindWithContent> for Option<Details> {
}),
KindWithContent::IndexSwap { .. } => None,
KindWithContent::CancelTask { .. } => None,
KindWithContent::DeleteTasks { .. } => todo!(),
KindWithContent::TaskDeletion { .. } => todo!(),
KindWithContent::DumpExport { dump_uid, .. } => Some(Details::Dump {
dump_uid: dump_uid.clone(),
}),