db-snapshot: Add error handling to metadata snapshot creation #930
1 changed files with 6 additions and 2 deletions
|
@ -484,7 +484,7 @@ impl AdminRpcHandler {
|
||||||
AdminRpc::MetaOperation(MetaOperation::Snapshot { all: false }),
|
AdminRpc::MetaOperation(MetaOperation::Snapshot { all: false }),
|
||||||
PRIO_NORMAL,
|
PRIO_NORMAL,
|
||||||
)
|
)
|
||||||
.await
|
.await?
|
||||||
}))
|
}))
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
|
@ -497,8 +497,12 @@ impl AdminRpcHandler {
|
||||||
ret.push(format!("{:?}\t{}", to, res_str));
|
ret.push(format!("{:?}\t{}", to, res_str));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if resps.iter().any(Result::is_err) {
|
||||||
|
Err(GarageError::Message(format_table_to_string(ret)).into())
|
||||||
|
} else {
|
||||||
Ok(AdminRpc::Ok(format_table_to_string(ret)))
|
Ok(AdminRpc::Ok(format_table_to_string(ret)))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
MetaOperation::Snapshot { all: false } => {
|
MetaOperation::Snapshot { all: false } => {
|
||||||
garage_model::snapshot::async_snapshot_metadata(&self.garage).await?;
|
garage_model::snapshot::async_snapshot_metadata(&self.garage).await?;
|
||||||
Ok(AdminRpc::Ok("Snapshot has been saved.".into()))
|
Ok(AdminRpc::Ok("Snapshot has been saved.".into()))
|
||||||
|
|
Loading…
Add table
Reference in a new issue