(clientId string)
| 180 | } |
| 181 | |
| 182 | func sendTEvents(clientId string) (int, error) { |
| 183 | numIters := 0 |
| 184 | totalEvents := 0 |
| 185 | for { |
| 186 | numIters++ |
| 187 | done, numEvents, err := sendTEventsBatch(clientId) |
| 188 | if err != nil { |
| 189 | log.Printf("error sending telemetry events: %v\n", err) |
| 190 | break |
| 191 | } |
| 192 | totalEvents += numEvents |
| 193 | if done { |
| 194 | break |
| 195 | } |
| 196 | if numIters > TEventsMaxBatches { |
| 197 | log.Printf("sendTEvents, hit %d iterations, stopping\n", numIters) |
| 198 | break |
| 199 | } |
| 200 | } |
| 201 | return totalEvents, nil |
| 202 | } |
| 203 | |
| 204 | func SendAllTelemetry(clientId string) error { |
| 205 | ctx, cancelFn := context.WithTimeout(context.Background(), 2*time.Second) |
no test coverage detected