File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -71,14 +71,15 @@ pub fn get_latest_release() -> &'static Option<LatestRelease> {
7171}
7272
7373// User Agent for Download API call
74- // Format: Parseable/<UID>/<version>/<commit_hash> (<OS>; <Platform>)
75- pub fn user_agent ( uid : & Ulid ) -> String {
74+ // Format: Parseable/<UID>/<version>/<commit_hash>/<send_analytics> (<OS>; <Platform>)
75+ pub fn user_agent ( uid : & Ulid , send_analytics : bool ) -> String {
7676 analytics:: refresh_sys_info ( ) ;
7777 format ! (
78- "Parseable/{}/{}/{} ({:?}; {})" ,
78+ "Parseable/{}/{}/{}/{} ({:?}; {})" ,
7979 uid,
8080 current( ) . released_version,
8181 current( ) . commit_hash,
82+ send_analytics,
8283 System :: name( ) . unwrap_or_default( ) ,
8384 platform( )
8485 )
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ use std::time::Duration;
2121use anyhow:: anyhow;
2222use chrono:: { DateTime , Utc } ;
2323
24- use crate :: about;
24+ use crate :: { about, parseable :: PARSEABLE } ;
2525
2626use super :: uid;
2727
@@ -32,11 +32,13 @@ pub struct LatestRelease {
3232}
3333
3434pub async fn get_latest ( deployment_id : & uid:: Uid ) -> Result < LatestRelease , anyhow:: Error > {
35+ let send_analytics = PARSEABLE . options . send_analytics ;
3536 let agent = reqwest:: ClientBuilder :: new ( )
36- . user_agent ( about:: user_agent ( deployment_id) )
37+ . user_agent ( about:: user_agent ( deployment_id, send_analytics ) )
3738 . timeout ( Duration :: from_secs ( 8 ) )
3839 . build ( )
3940 . expect ( "client can be built on this system" ) ;
41+
4042 let json: serde_json:: Value = agent
4143 . get ( "https://download.parseable.io/latest-version" )
4244 . send ( )
You can’t perform that action at this time.
0 commit comments