Rename ZedHttpClient
for clarity (#8320)
This PR renames the `ZedHttpClient` to `HttpClientWithUrl` to make it slightly clearer that it still is holding a `dyn HttpClient` as opposed to being a concrete implementation. Release Notes: - N/A
This commit is contained in:
parent
58463b2e97
commit
ba4e1699ae
7 changed files with 77 additions and 70 deletions
|
@ -20,7 +20,7 @@ use telemetry_events::{
|
|||
EditEvent, EditorEvent, Event, EventRequestBody, EventWrapper, MemoryEvent, SettingEvent,
|
||||
};
|
||||
use tempfile::NamedTempFile;
|
||||
use util::http::{self, HttpClient, Method, ZedHttpClient};
|
||||
use util::http::{self, HttpClient, HttpClientWithUrl, Method};
|
||||
#[cfg(not(debug_assertions))]
|
||||
use util::ResultExt;
|
||||
use util::TryFutureExt;
|
||||
|
@ -29,7 +29,7 @@ use self::event_coalescer::EventCoalescer;
|
|||
|
||||
pub struct Telemetry {
|
||||
clock: Arc<dyn SystemClock>,
|
||||
http_client: Arc<ZedHttpClient>,
|
||||
http_client: Arc<HttpClientWithUrl>,
|
||||
executor: BackgroundExecutor,
|
||||
state: Arc<Mutex<TelemetryState>>,
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ static ZED_CLIENT_CHECKSUM_SEED: Lazy<Option<Vec<u8>>> = Lazy::new(|| {
|
|||
impl Telemetry {
|
||||
pub fn new(
|
||||
clock: Arc<dyn SystemClock>,
|
||||
client: Arc<ZedHttpClient>,
|
||||
client: Arc<HttpClientWithUrl>,
|
||||
cx: &mut AppContext,
|
||||
) -> Arc<Self> {
|
||||
let release_channel =
|
||||
|
@ -474,7 +474,7 @@ impl Telemetry {
|
|||
|
||||
let request = http::Request::builder()
|
||||
.method(Method::POST)
|
||||
.uri(this.http_client.zed_api_url("/telemetry/events"))
|
||||
.uri(this.http_client.build_zed_api_url("/telemetry/events"))
|
||||
.header("Content-Type", "text/plain")
|
||||
.header("x-zed-checksum", checksum)
|
||||
.body(json_bytes.into());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue