test the details of all tasks type

This commit is contained in:
Irevoire 2022-10-26 11:09:44 +02:00 committed by Tamo
parent 6167baa9eb
commit 1cf081f9a3
4 changed files with 642 additions and 3 deletions

View file

@ -439,6 +439,7 @@ pub async fn update_all(
Some(&req),
);
println!("Registering a setting update");
let allow_index_creation = index_scheduler.filters().allow_index_creation;
let index_uid = IndexUid::try_from(index_uid.into_inner())?.into_inner();
let task = KindWithContent::SettingsUpdate {

View file

@ -20,7 +20,7 @@ pub fn configure(cfg: &mut web::ServiceConfig) {
#[derive(Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase", deny_unknown_fields)]
pub struct SwapIndexesPayload {
swap: (String, String),
indexes: (String, String),
}
pub async fn swap_indexes(
@ -33,7 +33,7 @@ pub async fn swap_indexes(
let mut indexes_set = HashSet::<String>::default();
let mut unknown_indexes = HashSet::new();
let mut duplicate_indexes = HashSet::new();
for SwapIndexesPayload { swap: (lhs, rhs) } in params.into_inner().into_iter() {
for SwapIndexesPayload { indexes: (lhs, rhs) } in params.into_inner().into_iter() {
if !search_rules.is_index_authorized(&lhs) {
unknown_indexes.insert(lhs.clone());
}