Add 5s timeout to LiveKit API requests
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
de24b4b4e8
commit
be1dc01d9e
1 changed files with 5 additions and 2 deletions
|
@ -3,7 +3,7 @@ use anyhow::{anyhow, Result};
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use prost::Message;
|
use prost::Message;
|
||||||
use reqwest::header::CONTENT_TYPE;
|
use reqwest::header::CONTENT_TYPE;
|
||||||
use std::{future::Future, sync::Arc};
|
use std::{future::Future, sync::Arc, time::Duration};
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
pub trait Client: Send + Sync {
|
pub trait Client: Send + Sync {
|
||||||
|
@ -29,7 +29,10 @@ impl LiveKitClient {
|
||||||
}
|
}
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
http: reqwest::Client::new(),
|
http: reqwest::ClientBuilder::new()
|
||||||
|
.timeout(Duration::from_secs(5))
|
||||||
|
.build()
|
||||||
|
.unwrap(),
|
||||||
url: url.into(),
|
url: url.into(),
|
||||||
key: key.into(),
|
key: key.into(),
|
||||||
secret: secret.into(),
|
secret: secret.into(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue