parent
7384bcaf40
commit
f9e976c224
6 changed files with 135 additions and 95 deletions
|
|
@ -36,9 +36,15 @@ pub struct CalendarClient {
|
|||
|
||||
impl CalendarClient {
|
||||
pub fn new(base_url: String, authenticator: Arc<Authenticator>) -> Self {
|
||||
let client = Client::builder()
|
||||
.timeout(std::time::Duration::from_secs(30))
|
||||
.connect_timeout(std::time::Duration::from_secs(10))
|
||||
.build()
|
||||
.unwrap_or_else(|_| Client::new());
|
||||
|
||||
Self {
|
||||
base_url: base_url.trim_end_matches('/').to_string(),
|
||||
client: Client::new(),
|
||||
client,
|
||||
authenticator,
|
||||
token_state: RwLock::new(None),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue