Add is_staff and destination to download events (#15445)
Release Notes: - N/A
This commit is contained in:
parent
2b871a631a
commit
0702ed5cd6
1 changed files with 30 additions and 10 deletions
|
@ -55,6 +55,8 @@ struct UpdateRequestBody {
|
||||||
installation_id: Option<Arc<str>>,
|
installation_id: Option<Arc<str>>,
|
||||||
release_channel: Option<&'static str>,
|
release_channel: Option<&'static str>,
|
||||||
telemetry: bool,
|
telemetry: bool,
|
||||||
|
is_staff: Option<bool>,
|
||||||
|
destination: &'static str,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq)]
|
#[derive(Clone, PartialEq, Eq)]
|
||||||
|
@ -575,18 +577,27 @@ async fn download_remote_server_binary(
|
||||||
cx: &AsyncAppContext,
|
cx: &AsyncAppContext,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
let mut target_file = File::create(&target_path).await?;
|
let mut target_file = File::create(&target_path).await?;
|
||||||
let (installation_id, release_channel, telemetry) = cx.update(|cx| {
|
let (installation_id, release_channel, telemetry_enabled, is_staff) = cx.update(|cx| {
|
||||||
let installation_id = Client::global(cx).telemetry().installation_id();
|
let telemetry = Client::global(cx).telemetry().clone();
|
||||||
|
let is_staff = telemetry.is_staff();
|
||||||
|
let installation_id = telemetry.installation_id();
|
||||||
let release_channel =
|
let release_channel =
|
||||||
ReleaseChannel::try_global(cx).map(|release_channel| release_channel.display_name());
|
ReleaseChannel::try_global(cx).map(|release_channel| release_channel.display_name());
|
||||||
let telemetry = TelemetrySettings::get_global(cx).metrics;
|
let telemetry_enabled = TelemetrySettings::get_global(cx).metrics;
|
||||||
|
|
||||||
(installation_id, release_channel, telemetry)
|
(
|
||||||
|
installation_id,
|
||||||
|
release_channel,
|
||||||
|
telemetry_enabled,
|
||||||
|
is_staff,
|
||||||
|
)
|
||||||
})?;
|
})?;
|
||||||
let request_body = AsyncBody::from(serde_json::to_string(&UpdateRequestBody {
|
let request_body = AsyncBody::from(serde_json::to_string(&UpdateRequestBody {
|
||||||
installation_id,
|
installation_id,
|
||||||
release_channel,
|
release_channel,
|
||||||
telemetry,
|
telemetry: telemetry_enabled,
|
||||||
|
is_staff,
|
||||||
|
destination: "remote",
|
||||||
})?);
|
})?);
|
||||||
|
|
||||||
let mut response = client.get(&release.url, request_body, true).await?;
|
let mut response = client.get(&release.url, request_body, true).await?;
|
||||||
|
@ -602,19 +613,28 @@ async fn download_release(
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
let mut target_file = File::create(&target_path).await?;
|
let mut target_file = File::create(&target_path).await?;
|
||||||
|
|
||||||
let (installation_id, release_channel, telemetry) = cx.update(|cx| {
|
let (installation_id, release_channel, telemetry_enabled, is_staff) = cx.update(|cx| {
|
||||||
let installation_id = Client::global(cx).telemetry().installation_id();
|
let telemetry = Client::global(cx).telemetry().clone();
|
||||||
|
let is_staff = telemetry.is_staff();
|
||||||
|
let installation_id = telemetry.installation_id();
|
||||||
let release_channel =
|
let release_channel =
|
||||||
ReleaseChannel::try_global(cx).map(|release_channel| release_channel.display_name());
|
ReleaseChannel::try_global(cx).map(|release_channel| release_channel.display_name());
|
||||||
let telemetry = TelemetrySettings::get_global(cx).metrics;
|
let telemetry_enabled = TelemetrySettings::get_global(cx).metrics;
|
||||||
|
|
||||||
(installation_id, release_channel, telemetry)
|
(
|
||||||
|
installation_id,
|
||||||
|
release_channel,
|
||||||
|
telemetry_enabled,
|
||||||
|
is_staff,
|
||||||
|
)
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let request_body = AsyncBody::from(serde_json::to_string(&UpdateRequestBody {
|
let request_body = AsyncBody::from(serde_json::to_string(&UpdateRequestBody {
|
||||||
installation_id,
|
installation_id,
|
||||||
release_channel,
|
release_channel,
|
||||||
telemetry,
|
telemetry: telemetry_enabled,
|
||||||
|
is_staff,
|
||||||
|
destination: "local",
|
||||||
})?);
|
})?);
|
||||||
|
|
||||||
let mut response = client.get(&release.url, request_body, true).await?;
|
let mut response = client.get(&release.url, request_body, true).await?;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue