modifications in several files to :

- have consistent error return types
- store the zone redundancy in a Lww
- print the error and message in the CLI (TODO: for the server Api, should msg be returned in the body response?)
This commit is contained in:
Mendes
2022-10-05 15:29:48 +02:00
parent 829f815a89
commit ceac3713d6
4 changed files with 100 additions and 63 deletions
+6 -1
View File
@@ -162,7 +162,12 @@ pub async fn handle_apply_cluster_layout(
let param = parse_json_body::<ApplyRevertLayoutRequest>(req).await?;
let layout = garage.system.get_cluster_layout();
let layout = layout.apply_staged_changes(Some(param.version))?;
let (layout, msg) = layout.apply_staged_changes(Some(param.version))?;
//TODO : how to display msg ? Should it be in the Body Response ?
for s in msg.iter() {
println!("{}", s);
}
garage.system.update_cluster_layout(&layout).await?;
Ok(Response::builder()