mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-10 07:12:54 +00:00
chore: show version report data only once at db startup (#2647)
This commit is contained in:
@@ -210,6 +210,7 @@ pub struct GreptimeDBTelemetry {
|
||||
working_home: Option<String>,
|
||||
telemetry_url: &'static str,
|
||||
should_report: Arc<AtomicBool>,
|
||||
report_times: usize,
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
@@ -242,6 +243,7 @@ impl GreptimeDBTelemetry {
|
||||
client: client.ok(),
|
||||
telemetry_url: TELEMETRY_URL,
|
||||
should_report,
|
||||
report_times: 0,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -259,8 +261,11 @@ impl GreptimeDBTelemetry {
|
||||
};
|
||||
|
||||
if let Some(client) = self.client.as_ref() {
|
||||
info!("reporting greptimedb version: {:?}", data);
|
||||
if self.report_times == 0 {
|
||||
info!("reporting greptimedb version: {:?}", data);
|
||||
}
|
||||
let result = client.post(self.telemetry_url).json(&data).send().await;
|
||||
self.report_times += 1;
|
||||
debug!("report version result: {:?}", result);
|
||||
result.ok()
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user