Delete room when no participants are left

This commit is contained in:
Antonio Scandurra 2022-10-18 14:57:31 +02:00
parent 9cf39b1da6
commit 48a1dd1588
5 changed files with 13 additions and 2 deletions

View file

@ -12,6 +12,7 @@ doctest = false
anyhow = "1.0.38"
futures = "0.3"
hmac = "0.12"
log = "0.4"
jwt = "0.16"
prost = "0.8"
prost-types = "0.8"

View file

@ -110,6 +110,7 @@ impl Client {
let client = self.http.clone();
let token = token::create(&self.key, &self.secret, None, grant);
let url = format!("{}/{}", self.url, path);
log::info!("Request {}: {:?}", url, body);
async move {
let token = token?;
let response = client
@ -119,9 +120,12 @@ impl Client {
.body(body.encode_to_vec())
.send()
.await?;
if response.status().is_success() {
log::info!("Response {}: {:?}", url, response.status());
Ok(Res::decode(response.bytes().await?)?)
} else {
log::error!("Response {}: {:?}", url, response.status());
Err(anyhow!(
"POST {} failed with status code {:?}, {:?}",
url,