Skip to content

Commit

Permalink
fix: set timeout for schema registry requests
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewinci committed Sep 26, 2022
1 parent b9cea94 commit 89add9e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src-tauri/src/schema_registry/mod.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
use url::Url;
use std::time::Duration;
use serde::{ de::DeserializeOwned, Deserialize, Serialize };

use crate::{ configuration::model::SchemaRegistry, error::{ Result } };

async fn get<T: DeserializeOwned>(url: String, config: &SchemaRegistry) -> Result<T> {
let client = reqwest::Client::new();
let mut request = client.get(url);
request = request.timeout(Duration::from_secs(5)); //todo: make it configurable
if let Some(username) = &config.username {
request = request.basic_auth(username, config.password.as_ref());
}
Expand Down

0 comments on commit 89add9e

Please sign in to comment.