lfs: use hg-http built client for network requests

Summary: This client provides automatic metrics collection.

Reviewed By: kulshrax

Differential Revision: D23577871

fbshipit-source-id: 137299222a20bc8e4d52c3321febbb91d861b236
This commit is contained in:
Stefan Filip 2020-09-09 17:32:44 -07:00 committed by Facebook GitHub Bot
parent 046db98222
commit 1c172c9008
2 changed files with 3 additions and 1 deletions

View File

@ -23,6 +23,7 @@ futures = "0.3"
hex = "0.4"
http = "0.2"
http-client = { path = "../http-client" }
hg-http= { path = "../hg-http" }
indexedlog = { path = "../indexedlog" }
lz4-pyframe = { path = "../lz4-pyframe" }
memmap = "0.7.0"

View File

@ -42,6 +42,7 @@ use configparser::{
config::ConfigSet,
hg::{ByteCount, ConfigSetHgExt},
};
use hg_http::http_client;
use http_client::{HttpClient, Method, Request};
use indexedlog::log::IndexOutput;
use lfs_protocol::{
@ -1225,7 +1226,7 @@ impl LfsRemote {
let request_timeout =
Duration::from_millis(config.get_or("lfs", "requesttimeout", || 10_000)?);
let client = HttpClient::new();
let client = http_client("lfs");
Ok(Self {
shared,