MCPcopy
hub / github.com/wavetermdev/waveterm / SendDiagnosticPing

Function SendDiagnosticPing

pkg/wcloud/wcloud.go:301–323  ·  view source on GitHub ↗
(ctx context.Context, clientId string, usageTelemetry bool)

Source from the content-addressed store, hash-verified

299}
300
301func SendDiagnosticPing(ctx context.Context, clientId string, usageTelemetry bool) error {
302 endpoint := GetPingEndpoint()
303 if endpoint == "" {
304 return nil
305 }
306 localDate := time.Now().Format("2006-01-02")
307 input := PingInputType{
308 ClientId: clientId,
309 Arch: wavebase.ClientArch(),
310 Version: "v" + wavebase.WaveVersion,
311 LocalDate: localDate,
312 UsageTelemetry: usageTelemetry,
313 }
314 req, err := makePingPostReq(ctx, PingUrl, input)
315 if err != nil {
316 return err
317 }
318 _, err = doRequest(req, nil, false)
319 if err != nil {
320 return err
321 }
322 return nil
323}

Callers 1

sendDiagnosticPingFunction · 0.92

Calls 4

ClientArchFunction · 0.92
GetPingEndpointFunction · 0.85
makePingPostReqFunction · 0.85
doRequestFunction · 0.85

Tested by

no test coverage detected