aboutsummaryrefslogtreecommitdiff
path: root/src/admin_rpc.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-04-19 17:59:59 +0000
committerAlex Auvolat <alex@adnab.me>2020-04-19 17:59:59 +0000
commitea75564851851b969ef23797537c813ba607b84a (patch)
treed5bdb1a19a546cbbd92e35dbd496acfd16522dd9 /src/admin_rpc.rs
parente325c7f47a9ad7777358b669f62a7c613f676ecd (diff)
downloadgarage-ea75564851851b969ef23797537c813ba607b84a.tar.gz
garage-ea75564851851b969ef23797537c813ba607b84a.zip
More aggressive sync timings & improve other stuff
Diffstat (limited to 'src/admin_rpc.rs')
-rw-r--r--src/admin_rpc.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/admin_rpc.rs b/src/admin_rpc.rs
index 8a274c26..29037c6c 100644
--- a/src/admin_rpc.rs
+++ b/src/admin_rpc.rs
@@ -18,7 +18,7 @@ pub enum AdminRPC {
BucketOperation(BucketOperation),
// Replies
- Ok,
+ Ok(String),
BucketList(Vec<String>),
BucketInfo(Bucket),
}
@@ -86,13 +86,13 @@ impl AdminRpcHandler {
self.garage
.bucket_table
.insert(&Bucket {
- name: query.name,
+ name: query.name.clone(),
timestamp: new_time,
deleted: false,
authorized_keys: vec![],
})
.await?;
- Ok(AdminRPC::Ok)
+ Ok(AdminRPC::Ok(format!("Bucket {} was created.", query.name)))
}
BucketOperation::Delete(query) => {
let bucket = match self
@@ -129,13 +129,13 @@ impl AdminRpcHandler {
self.garage
.bucket_table
.insert(&Bucket {
- name: query.name,
+ name: query.name.clone(),
timestamp: std::cmp::max(bucket.timestamp + 1, now_msec()),
deleted: true,
authorized_keys: vec![],
})
.await?;
- Ok(AdminRPC::Ok)
+ Ok(AdminRPC::Ok(format!("Bucket {} was deleted.", query.name)))
}
_ => {
// TODO