various: shared HTTP client with connection pooling
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Id13c17e9352da970a289f4e3ad909c5b6a6a6964
This commit is contained in:
parent
0cc72e9916
commit
7ee9ee1159
6 changed files with 64 additions and 20 deletions
|
|
@ -1,4 +1,4 @@
|
|||
use std::collections::HashMap;
|
||||
use std::{collections::HashMap, sync::Arc};
|
||||
|
||||
use async_trait::async_trait;
|
||||
use regex::Regex;
|
||||
|
|
@ -20,9 +20,9 @@ pub struct GitHubPlatform {
|
|||
}
|
||||
|
||||
impl GitHubPlatform {
|
||||
pub fn new(token: Option<String>) -> Self {
|
||||
pub fn with_client(client: Arc<Client>, token: Option<String>) -> Self {
|
||||
Self {
|
||||
client: Client::new(),
|
||||
client: (*client).clone(),
|
||||
token,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue