Skip to content

Commit

Permalink
fix: add gh_client read timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
vladkens committed Sep 8, 2024
1 parent 1585df2 commit 508ef91
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/gh_client.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::vec;
use std::{time::Duration, vec};

use reqwest::{
header::{HeaderMap, HeaderValue},
Expand Down Expand Up @@ -84,9 +84,12 @@ impl GhClient {
headers.insert("Authorization", auth_header);
headers.insert("User-Agent", HeaderValue::from_str(&user_agent)?);

let client = reqwest::Client::builder().default_headers(headers).build()?;
let base_url = "https://api.github.com".to_string();
let client = reqwest::Client::builder()
.default_headers(headers)
.read_timeout(Duration::from_secs(30))
.build()?;

let base_url = "https://api.github.com".to_string();
Ok(GhClient { client, base_url })
}

Expand Down

0 comments on commit 508ef91

Please sign in to comment.