Support website publishing #7

Merged
lx merged 61 commits from feature/website into master 2021-01-15 16:49:51 +00:00
Showing only changes of commit f496e41ef4 - Show all commits

View file

@ -175,9 +175,7 @@ impl AdminRpcHandler {
Ok(AdminRPC::Ok(msg.to_string())) Ok(AdminRPC::Ok(msg.to_string()))
} else { } else {
quentin marked this conversation as resolved
Review

Probably put unreachable!() in else branch ? Because get_existing_bucket does not return a bucket that is deleted. (I think so, this should be checked)

Probably put `unreachable!()` in else branch ? Because get_existing_bucket does not return a bucket that is deleted. (I think so, this should be checked)
Review

Checked.
Indeed, it does not return deleted buckets.

        async fn get_existing_bucket(&self, bucket: &String) -> Result<Bucket, Error> {
                self.garage
                        .bucket_table
                        .get(&EmptyKey, bucket)
                        .await?
                        .filter(|b| !b.is_deleted())
                        .map(Ok)
                        .unwrap_or(Err(Error::BadRPC(format!(
                                "Bucket {} does not exist",
                                bucket
                        ))))
        }
Checked. Indeed, it does not return deleted buckets. ```rust async fn get_existing_bucket(&self, bucket: &String) -> Result<Bucket, Error> { self.garage .bucket_table .get(&EmptyKey, bucket) .await? .filter(|b| !b.is_deleted()) .map(Ok) .unwrap_or(Err(Error::BadRPC(format!( "Bucket {} does not exist", bucket )))) } ```
return Err(Error::Message(format!( unreachable!();
"Bucket is deleted in update_bucket_key"
)));
} }
quentin marked this conversation as resolved
Review

update_bucket_key ?

`update_bucket_key` ?
} }
} }