up
This commit is contained in:
parent
3169343526
commit
e36d2cb6b8
|
@ -328,25 +328,21 @@ func (a *apic) SendUsageMetrics() {
|
||||||
metrics, metricsId, err := a.GetUsageMetrics()
|
metrics, metricsId, err := a.GetUsageMetrics()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("unable to get usage metrics: %s", err)
|
log.Errorf("unable to get usage metrics: %s", err)
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
/*jsonStr, err := json.Marshal(metrics)
|
|
||||||
if err != nil {
|
|
||||||
log.Errorf("unable to marshal usage metrics (%s)", err)
|
|
||||||
}*/
|
|
||||||
//fmt.Printf("Usage metrics: %s\n", string(jsonStr))
|
|
||||||
_, _, err = a.apiClient.UsageMetrics.Add(context.Background(), metrics)
|
_, _, err = a.apiClient.UsageMetrics.Add(context.Background(), metrics)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("unable to send usage metrics: %s", err)
|
log.Errorf("unable to send usage metrics: %s", err)
|
||||||
} else {
|
continue
|
||||||
|
}
|
||||||
err = a.MarkUsageMetricsAsSent(metricsId)
|
err = a.MarkUsageMetricsAsSent(metricsId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("unable to mark usage metrics as sent: %s", err)
|
log.Errorf("unable to mark usage metrics as sent: %s", err)
|
||||||
} else {
|
continue
|
||||||
|
}
|
||||||
log.Infof("Usage metrics sent")
|
log.Infof("Usage metrics sent")
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue