Use reqwest client with timeout in gitea.rs and bot.rs
This commit is contained in:
1 parent
01e13f0081
commit
3501e4ae9d
2 files changed
+13
-7
No files matched your search
+1
-4
@@ -8,7 +8,6 @@ use crate::errors::AppError;
|
||||
pub struct GiteaAPI {
|
||||
base_url: String,
|
||||
client: reqwest::Client,
|
||||
token: String,
|
||||
}
|
||||
|
||||
impl GiteaAPI {
|
||||
@@ -24,9 +23,7 @@ impl GiteaAPI {
|
||||
client: reqwest::Client::builder()
|
||||
.timeout(Duration::from_secs(timeout))
|
||||
.default_headers(default_headers)
|
||||
.build()
|
||||
.unwrap(),
|
||||
token: String::from(token),
|
||||
.build()?,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user