timeout added #29

Merged
VladislavD merged 1 commits from feature/135 into rc 2025-04-30 14:05:47 +03:00
1 changed files with 2 additions and 0 deletions

View File

@ -37,6 +37,7 @@ impl Requester {
pub async fn get_conferences(&self) -> anyhow::Result<Value> { pub async fn get_conferences(&self) -> anyhow::Result<Value> {
let url = format!("{}{}", self.base, *CONFERENCES_ENDPOINT); let url = format!("{}{}", self.base, *CONFERENCES_ENDPOINT);
let req = self.client.get(url) let req = self.client.get(url)
.timeout(tokio::time::Duration::from_secs(10))
.header("accept", "application/json") .header("accept", "application/json")
.header("x-api-key", &self.api_key); .header("x-api-key", &self.api_key);
let resp = req.send().await; let resp = req.send().await;
@ -83,6 +84,7 @@ impl Requester {
for conf in conferences { for conf in conferences {
let url = format!("{}{}{}", self.base, *USERS_ENDPOINT, &conf.1); let url = format!("{}{}{}", self.base, *USERS_ENDPOINT, &conf.1);
let req = self.client.get(url) let req = self.client.get(url)
.timeout(tokio::time::Duration::from_secs(10))
.header("accept", "application/json") .header("accept", "application/json")
.header("x-api-key", &self.api_key); .header("x-api-key", &self.api_key);